Skip to content

Commit 4ca5591

Browse files
committed
Merge pull request cocos2d#5 from cocos2d/master
update cocos2d-x
2 parents 3d2a505 + b791e44 commit 4ca5591

File tree

201 files changed

+8001
-2814
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+8001
-2814
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ build_*_vc10/
6464
xcschememanagement.plist
6565
build/
6666
.DS_Store
67+
._.*
6768
xcuserdata/
6869
DerivedData/
6970

AUTHORS

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ Developers:
1212
Rolando Abarca
1313
Javascript Binding and testjs
1414

15+
biteforest
16+
fix cc scale9 sprite bug
17+
1518
Jimmy Sambuo
1619
fix the bug that SimpleAudioEngine::playEffect() and playBackgroundMusic() play twice on linux
1720

@@ -71,6 +74,8 @@ Developers:
7174
Used fontconfig to enhance font rendering on linux.
7275
Fixed a bug about missing horizontal alignment for Custom TTF fonts on linux.
7376
Fixed a bug that the truetype fonts from resource directory can't be found on linux.
77+
Fixed the size calculations for true type fonts (especially for italic fonts).
78+
Added a very simple greedy line break algorithmfor true type labels.
7479

7580
Nat Weiss (iphonegamekit.com)
7681
author of Mac port
@@ -98,6 +103,7 @@ Developers:
98103

99104
Rohan Kuruvilla (rohankuruvilla, Zynga)
100105
Improvements to JS Bindings.
106+
Synchronizing CCBReader to version 5.
101107

102108
Jianfeng Zou (NetDragon Inc)
103109
contributes CCListView and CCTextureWatcher.
@@ -225,6 +231,7 @@ Developers:
225231

226232
neokim
227233
Adds 'setFont' and 'setAnchorPoint' to CCEditBox.
234+
Workaround for some problems due to UITextField of CCEditBoxImplIOS is attached as a view above OpenGL view.
228235

229236
Sam Clegg (sbc100)
230237
Author of Native Client port.
@@ -241,6 +248,12 @@ Developers:
241248
Asad ur Rehman (AsadR)
242249
Adding CCNotificationCenter::removeAllObservers(CCObject *target).
243250

251+
jedy
252+
Fix of CCNode.h's document with doxygen 1.8.3 can't be generated.
253+
254+
whitegfx
255+
Implementation of kEditBoxInputFlagSensitive setting for CCEditBoxImplIOS.
256+
244257
Retired Core Developers:
245258
WenSheng Yang
246259
Author of windows port, CCTextField,

CHANGELOG

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,86 @@
1+
cocos2d-2.1rc0-x-2.1.2 @Mar.20 2013
2+
[all platforms]
3+
Bug #1529: use NSUserDefaults on iOS and SharedPreferences on Android implement CCUserDefault
4+
Bug #1672: fix a bug that CCTableView is too sensitive on some devices with high density display
5+
Bug #1689: support horizontal alignment for Custom TTF fonts
6+
Bug #1691: fix a bug that CCControlSwitch::setOn(isOn,false) doesn't work
7+
Bug #1692: add TMX polygon parsing
8+
Bug #1697: fix a logical error in CCRenderTexture::initWithWidthAndHeight()
9+
Bug #1710: add simpler,correct handling of spritesheet sources for CCScale9Sprite
10+
Bug #1711: fix a bug that clipping rectangle of CCScrollView is wrong when the scale of its ancestors isn't equal to 1
11+
Bug #1731: change declaration of CCSize, CCPoint and CCRect in pkg file
12+
Bug #1751: fix a bug that clicking outside of CCTableViewCell will also get response when container size is smaller than view size
13+
Bug #1754: fix a bug that offset of the container is wrong in CCTableView
14+
Bug #1821: fix a bug that the display result is wrong when invoking CCControlButton::setHighlighted()
15+
Feature #1686: synchronize to cocos2d-iphone v2.1rc0
16+
Feature #1708: adding Portuguese and Arabic language support
17+
Feature #1712: add an interface to get DPI
18+
Feature #1741: CCLens3d can be concave
19+
Feature #1742: add 'rotationIsDir' property to ParticleSystem
20+
Feature #1761: implement setVisible() for CCEditBox
21+
Feature #1807: add getStartLocationInView() and getStartLocation() methods in CCTouch
22+
Feature #1822: add CCNotificationCenter::removeAllObservers(CCObject *target)
23+
Feature #1838: synchronize CCBReader to the lastest version
24+
Feature #1489: add AssetsManager
25+
Refactor #1687: refactor CCFileUtils and CCImage
26+
Refactor #1700: add webp image format support
27+
Refactor #1702: change return value of CCFileUtils::getWritablePath()
28+
Refactor #1703: replace libxml2 with tinyxml2
29+
Refactor #1749: add 'setFont' and 'setAnchorPoint' to CCEditBox
30+
[android]
31+
Bug #1752: fix a bug that libcurl.a causes link error after being stripped
32+
Bug #1760: fix a bug that cpufeatures module is redefined
33+
Bug #1775: fix a bug that OpenSLEngine can not load resources from SD card
34+
Bug #1812: fix a warning of getStringWithEllipsisJni() function when compiling it with clang
35+
Feature #1827: support building android project, including native codes, in Eclipse
36+
[iOS]
37+
Bug #1750: fix a bug that CCEditBox's position is incorrect when it's added to a non-fullscreen CCNode
38+
Bug #1804: fix for loading custom fonts on iOS when referenced from a CCB file
39+
Feature #1842: support kEditBoxInputFlagSensitive setting for CCEditBox on iOS
40+
Refactor #1755: add CocosDenshion xcode project
41+
Refactor #1825: use CCLabelTTF to show text for CCEditBox
42+
[javascript binding]
43+
Bug #1707: fix a crash caused by unaligned memory access in CCBReader::readFloat()
44+
Bug #1726: fix crash of JSB application on android device with armv6 architecture
45+
Bug #1729: fix compiling error of ScriptingCore.cpp with C++11 on iOS
46+
Bug #1747: fix a crash when passing null to cc.AnimationFrame.initWithSpriteFrame()
47+
Bug #1823: use shared NodeLoaderLibrary in CCBReader bindings
48+
Feature #1724: add HelloJS sample
49+
Feature #1730: bind CCScrollView and CCTableView to js
50+
Feature #1748: separate chipmunk and sqlite from js_binding_core.cpp
51+
Feature #1753: upgrade SpiderMonkey to Firefox19.
52+
Feature #1808: make cxx_generator support parsing functions that have default parameters
53+
Feature #1811: add a method to get file data for JSB
54+
Feature #1824: bind CCEditBox to JS
55+
Refactor #1682: add ScriptingCore::getGlobalObject() function
56+
Refactor #1740: add cleanup and reset methods to ScriptingCore
57+
Refactor #1830: use JS::CompileOptions::setUTF8(true) to compile script
58+
Refactor #1836: make js target of "cc.Scheduler().scheduleCallbackForTarget()" accept a object that not depend on CCNode or its subclass
59+
Refactor #1837: refactor schedule binding codes
60+
[lua binding]
61+
Bug #1745: fix a bug that CCRepeat:create() receives error argument
62+
Feature #1425: fix errors in lua test cases and add more test cases
63+
Feature #1698: add CCLuaObjcBridge
64+
Feature #1802: add TouchesTest for lua binding
65+
Refactor #1818: cleanup the tolua++ bindings build system
66+
[win32]
67+
Feature #1634: CCEditBox support
68+
Feature #1746: add VS2012 Express template installing support
69+
[linux]
70+
Bug #1688: fix a bug that truetype fonts from resource directory can't be found
71+
Bug #1810: fix a bug that SimpleAudioEngine::playEffect() and playBackgroundMusic() play twice on linux
72+
Bug #1819: fix a bug that building script exits when missing packages
73+
Bug #1834: fix the size calculations for true type fonts (especially for italic fonts)
74+
Refactor #1806: refactor linux build system
75+
Refactor #1820: add 'make run' target for linux projects
76+
[mac os]
77+
Bug #1637: fix a bug that CCLabelTTF & CCMenuItemLabel cannot display on Mac Retina
78+
[black berry]
79+
Refactor #1709: add support for multiple background music sources
80+
[chrome native client]
81+
Feature #1762: add Native Client support
82+
83+
184
cocos2d-2.1beta3-x-2.1.1 @Jan.29 2013
285
[ all platforms]
386
Bug #1547: fix a bug that when CCMenuItem is removed before touch ended, application will crash if keeping moving

cocos2d-win32.vc2010.sln

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "scripting\lua\pro
1919
EndProjectSection
2020
EndProject
2121
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}"
22+
ProjectSection(ProjectDependencies) = postProject
23+
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}
24+
{207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}
25+
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}
26+
EndProjectSection
2227
EndProject
2328
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp", "samples\Cpp\HelloCpp\proj.win32\HelloCpp.vcxproj", "{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}"
2429
EndProject
@@ -92,6 +97,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AssetsManagerTest", "sample
9297
EndProjectSection
9398
EndProject
9499
Global
100+
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
101+
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
102+
EndGlobalSection
95103
GlobalSection(SolutionConfigurationPlatforms) = preSolution
96104
Debug|Win32 = Debug|Win32
97105
Release|Win32 = Release|Win32
@@ -188,7 +196,4 @@ Global
188196
{39379840-825A-45A0-B363-C09FFEF864BD} = {68B43009-A1C1-41B2-8AF7-77278B70E897}
189197
{9A17D9A4-4B11-4E32-94F6-895FF4909EC5} = {68B43009-A1C1-41B2-8AF7-77278B70E897}
190198
EndGlobalSection
191-
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
192-
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
193-
EndGlobalSection
194199
EndGlobal

cocos2d-win32.vc2012.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ EndProject
2121
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "extensions\proj.win32\libExtensions.vcxproj", "{21B2C324-891F-48EA-AD1A-5AE13DE12E28}"
2222
ProjectSection(ProjectDependencies) = postProject
2323
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}
24+
{207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}
25+
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}
2426
EndProjectSection
2527
EndProject
2628
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCpp", "samples\Cpp\HelloCpp\proj.win32\HelloCpp.vcxproj", "{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}"
@@ -87,6 +89,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJSBinding", "scripting\j
8789
EndProjectSection
8890
EndProject
8991
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CrystalCraze", "samples\Javascript\CrystalCraze\proj.win32\CrystalCraze.vcxproj", "{9A17D9A4-4B11-4E32-94F6-895FF4909EC5}"
92+
ProjectSection(ProjectDependencies) = postProject
93+
{21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28}
94+
{39379840-825A-45A0-B363-C09FFEF864BD} = {39379840-825A-45A0-B363-C09FFEF864BD}
95+
EndProjectSection
9096
EndProject
9197
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AssetsManagerTest", "samples\Cpp\AssetsManagerTest\proj.win32\AssetsManagerTest.vcxproj", "{6D37505F-A890-441D-BD3F-A61E2C0469CE}"
9298
EndProject

cocos2dx/CCScheduler.cpp

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,8 @@ void CCScheduler::scheduleUpdateForTarget(CCObject *pTarget, int nPriority, bool
472472
if (nPriority == 0)
473473
{
474474
appendIn(&m_pUpdates0List, pTarget, bPaused);
475-
} else
476-
if (nPriority < 0)
475+
}
476+
else if (nPriority < 0)
477477
{
478478
priorityIn(&m_pUpdatesNegList, pTarget, nPriority, bPaused);
479479
}
@@ -785,18 +785,11 @@ void CCScheduler::update(float dt)
785785
// Iterate over all the Updates' selectors
786786
tListEntry *pEntry, *pTmp;
787787

788-
CCScriptEngineProtocol* pEngine = CCScriptEngineManager::sharedManager()->getScriptEngine();
789-
790788
// updates with priority < 0
791789
DL_FOREACH_SAFE(m_pUpdatesNegList, pEntry, pTmp)
792790
{
793791
if ((! pEntry->paused) && (! pEntry->markedForDeletion))
794792
{
795-
if (pEngine != NULL && kScriptTypeJavascript == pEngine->getScriptType())
796-
{
797-
pEngine->executeSchedule(0, dt, (CCNode *)pEntry->target);
798-
}
799-
800793
pEntry->target->update(dt);
801794
}
802795
}
@@ -806,11 +799,6 @@ void CCScheduler::update(float dt)
806799
{
807800
if ((! pEntry->paused) && (! pEntry->markedForDeletion))
808801
{
809-
if (pEngine != NULL && kScriptTypeJavascript == pEngine->getScriptType())
810-
{
811-
pEngine->executeSchedule(0, dt, (CCNode *)pEntry->target);
812-
}
813-
814802
pEntry->target->update(dt);
815803
}
816804
}
@@ -820,11 +808,6 @@ void CCScheduler::update(float dt)
820808
{
821809
if ((! pEntry->paused) && (! pEntry->markedForDeletion))
822810
{
823-
if (pEngine != NULL && kScriptTypeJavascript == pEngine->getScriptType())
824-
{
825-
pEngine->executeSchedule(0, dt, (CCNode *)pEntry->target);
826-
}
827-
828811
pEntry->target->update(dt);
829812
}
830813
}

cocos2dx/base_nodes/CCNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ void CCNode::update(float fDelta)
11051105
{
11061106
if (m_nUpdateScriptHandler)
11071107
{
1108-
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeSchedule(m_nUpdateScriptHandler, fDelta);
1108+
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeSchedule(m_nUpdateScriptHandler, fDelta, this);
11091109
}
11101110
}
11111111

cocos2dx/base_nodes/CCNode.h

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ enum {
125125
class CC_DLL CCNode : public CCObject
126126
{
127127
public:
128-
//////////////////////////////
129128
/// @{
130129
/// @name Constructor, Distructor and Initializers
131130

@@ -160,7 +159,6 @@ class CC_DLL CCNode : public CCObject
160159

161160

162161

163-
///////////////////////////////////////////////////////
164162
/// @{
165163
/// @name Setters & Getters for Graphic Peroperties
166164

@@ -549,7 +547,6 @@ class CC_DLL CCNode : public CCObject
549547
/// @} end of Setters & Getters for Graphic Peroperties
550548

551549

552-
///////////////////////////////////////////////////////
553550
/// @{
554551
/// @name Children and Parent
555552

@@ -705,7 +702,6 @@ class CC_DLL CCNode : public CCObject
705702

706703

707704

708-
////////////////////////////////////
709705
/// @{
710706
/// @name Grid object for effects
711707

@@ -725,7 +721,6 @@ class CC_DLL CCNode : public CCObject
725721
/// @} end of Grid
726722

727723

728-
/////////////////////////////////////
729724
/// @{
730725
/// @name Tag & User data
731726

@@ -814,7 +809,6 @@ class CC_DLL CCNode : public CCObject
814809
/// @} end of Tag & User Data
815810

816811

817-
///////////////////////////////
818812
/// @{
819813
/// @name Shader Program
820814
/**
@@ -837,8 +831,6 @@ class CC_DLL CCNode : public CCObject
837831
virtual void setShaderProgram(CCGLProgram *pShaderProgram);
838832
/// @} end of Shader Program
839833

840-
///////////////////////////////////////
841-
///////////////////////////////////////
842834

843835
/**
844836
* Returns a camera object that lets you move the node using a gluLookAt
@@ -863,7 +855,6 @@ class CC_DLL CCNode : public CCObject
863855
virtual bool isRunning();
864856

865857

866-
/////////////////////////////////
867858
/// @{
868859
/// @name Script Bindings for lua
869860

@@ -912,7 +903,6 @@ class CC_DLL CCNode : public CCObject
912903
/// @} end Script Bindings
913904

914905

915-
//////////////////////////
916906
/// @{
917907
/// @name Event Callbacks
918908

@@ -981,7 +971,6 @@ class CC_DLL CCNode : public CCObject
981971
*/
982972
CCRect boundingBox(void);
983973

984-
/////////////////////////////////////////
985974
/// @{
986975
/// @name Actions
987976

@@ -1053,7 +1042,6 @@ class CC_DLL CCNode : public CCObject
10531042
/// @} end of Actions
10541043

10551044

1056-
//////////////////
10571045
/// @{
10581046
/// @name Scheduler and Timer
10591047

@@ -1176,9 +1164,9 @@ class CC_DLL CCNode : public CCObject
11761164
* Update method will be called automatically every frame if "scheduleUpdate" is called, and the node is "live"
11771165
*/
11781166
virtual void update(float delta);
1179-
11801167

1181-
////////////////////////////
1168+
/// @} end of Scheduler and Timer
1169+
11821170
/// @{
11831171
/// @name Transformations
11841172

@@ -1226,7 +1214,6 @@ class CC_DLL CCNode : public CCObject
12261214
/// @} end of Transformations
12271215

12281216

1229-
///////////////////
12301217
/// @{
12311218
/// @name Coordinate Converters
12321219

cocos2dx/cocoa/CCSet.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ CCSet::~CCSet(void)
5656
CC_SAFE_DELETE(m_pSet);
5757
}
5858

59+
CCSet * CCSet::create()
60+
{
61+
CCSet * pRet = new CCSet();
62+
63+
if (pRet != NULL)
64+
{
65+
pRet->autorelease();
66+
}
67+
68+
return pRet;
69+
}
70+
5971
CCSet* CCSet::copy(void)
6072
{
6173
CCSet *pSet = new CCSet(*this);

cocos2dx/cocoa/CCSet.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ class CC_DLL CCSet : public CCObject
4444
CCSet(const CCSet &rSetObject);
4545
virtual ~CCSet(void);
4646

47+
/**
48+
* @brief Create and return a new empty set.
49+
*/
50+
static CCSet * create();
51+
4752
/**
4853
*@brief Return a copy of the CCSet, it will copy all the elements.
4954
*/

0 commit comments

Comments
 (0)