diff --git a/AUTHORS b/AUTHORS
index e9e9359b76..1dafbf6596 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -12,6 +12,15 @@ Developers:
Rolando Abarca
Javascript Binding and testjs
+ fape
+ add Hungarian language support
+
+ chenium
+ fix a bug that CCRenderTexture can not work when coming to foreground on Android
+
+ 9re(Taro Kobayashi)
+ add Japanese language support
+
mingulov
improve the speed of accessing to files from apk
diff --git a/CHANGELOG b/CHANGELOG
index 6144697cf4..c2b6a5764a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,36 @@
+cocos2d-2.1beta3-x-2.1.0 @Dec.5 2012
+ [all platforms]
+ Bug #1556: set a default texture for CCParticleFire, CCParticleFireworks, etc
+ Feature #1555: update to cocos2d-iphone v2.1 beta3
+ Feature #1564: update tests to cocos2d-iphone v2.1beta3
+ Feature #1572: add sample game WatermelonWithMe
+ Feature #1573: add sample game CocosDragonJS
+ Refactor #1545: remove the usage of NODE_FUNC and CREATE_FUNC
+ Refactor #1565: remove VS2008 support
+ Refactor #1576: update CCBReader to latest version of CocosBuilder
+ Refactor #1589: add CCBReader::setCCBRootPath()
+ [iOS]
+ Bug #1548: update libcurl header files to 7.26.0 on iOS
+ [android]
+ Bug #1551: add error handler when reading image data using libjpeg
+ Refactor #1558: improve the speed of accessing to files from apk
+ [marmalade]
+ Bug #1559: fix a bug that if a file in resource directory doesn't exist, it will not search from root directory
+ Bug #1571: add box2d rope to marmalade project
+ Bug #1590: JPEG and File fixes for marmalade
+ Feature #1557: Marmalade support
+ Refactor #1574: update marmalade languages
+ Refactor #1575: update samples/TestCpp to compatible with marmalade
+ Refactor #1578: create cocos2dx-ext marmalade project
+ Refactor #1591: add TestLua marmalade project
+ [javascript binding]
+ Bug #1577: fix a bug that touch events lost on Win32 when using JSBinding
+ Bug #1586: fix a crash in WatermelonWithMe
+ Bug #1588: rescheduleCallback support for JSBinding
+ Refactor #1570: improve the debugger for JSBinding
+ [lua binding]
+ Bug #1587: remove lua script handler in CCCallFunc's destructor
+
cocos2d-2.0-x-2.0.4 @Nov.2 2012
[all platforms]
Bug #1473: fix a bug that CCScale9Sprite does not support rotated spriteframe in atlas
diff --git a/build-win32.bat b/build-win32.bat
index ffd7c9f32c..a6a4b6104b 100644
--- a/build-win32.bat
+++ b/build-win32.bat
@@ -45,15 +45,17 @@ cd ".\Release.win32\"
set CC_TEST_BIN=TestCpp.exe
-set CC_TEST_RES=..\samples\TestCpp\Resources\*.*
-set CC_HELLOWORLD_RES=..\samples\HelloCpp\Resources\*.*
-set CC_HELLOLUA_RES=..\samples\HelloLua\Resources\*.*
-set CC_TESTJS_RES=..\samples\TestJavascript\Resources\*.*
+set CC_TEST_RES=..\samples\TestCpp\Resources
+set CC_HELLOWORLD_RES=..\samples\HelloCpp\Resources
+set CC_TESTLUA_RES=..\samples\TestLua\Resources
+set CC_SIMPLEGAME_RES=..\samples\SimpleGame\Resources
+set CC_HELLOLUA_RES=..\samples\HelloLua\Resources
+set CC_JSB_SOURCES=..\scripting\javascript\bindings\js
+set CC_TESTJS_RES=..\samples\TestJavascript\cocos2d-js-tests\tests
+set CC_DRAGONJS_RES=..\samples\TestJavascript\cocos2d-js-tests\games\CocosDragonJS\Published files iOS
+set CC_MOONWARRIORS_RES=..\samples\TestJavascript\cocos2d-js-tests\games\MoonWarriors
+set CC_WATERMELONWITHME_RES=..\samples\TestJavascript\cocos2d-js-tests\games\WatermelonWithMe
-if not exist "%CC_TEST_BIN%" (
- echo Can't find the binary "TestCpp.exe", is there build error?
- goto ERROR
-)
echo./*
echo.* Run cocos2d-win32 tests.exe and view Cocos2d-x Application Wizard for Visual Studio User Guide.
@@ -62,7 +64,18 @@ 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%"
start http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Cocos2d-x_Application_Wizard_for_Visual_Studio_User_Guide
diff --git a/cocos2dx/cocoa/CCSet.cpp b/cocos2dx/cocoa/CCSet.cpp
index f284d9c937..8ab306af56 100644
--- a/cocos2dx/cocoa/CCSet.cpp
+++ b/cocos2dx/cocoa/CCSet.cpp
@@ -52,18 +52,7 @@ CCSet::CCSet(const CCSet &rSetObject)
CCSet::~CCSet(void)
{
- // call release() of elements
- CCSetIterator iter;
- for (iter = m_pSet->begin(); iter != m_pSet->end(); ++iter)
- {
- if (! (*iter))
- {
- break;
- }
-
- (*iter)->release();
- }
-
+ removeAllObjects();
CC_SAFE_DELETE(m_pSet);
}
@@ -96,6 +85,20 @@ void CCSet::removeObject(CCObject *pObject)
CC_SAFE_RELEASE(pObject);
}
+void CCSet::removeAllObjects()
+{
+ CCSetIterator it;
+ for (it = m_pSet->begin(); it != m_pSet->end(); ++it)
+ {
+ if (! (*it))
+ {
+ break;
+ }
+
+ (*it)->release();
+ }
+}
+
bool CCSet::containsObject(CCObject *pObject)
{
return m_pSet->find(pObject) != m_pSet->end();
diff --git a/cocos2dx/cocoa/CCSet.h b/cocos2dx/cocoa/CCSet.h
index e6513c3685..9c6a621862 100644
--- a/cocos2dx/cocoa/CCSet.h
+++ b/cocos2dx/cocoa/CCSet.h
@@ -64,6 +64,10 @@ public:
*@brief Remove the given element, nothing todo if no element equals pObject.
*/
void removeObject(CCObject *pObject);
+ /**
+ *@brief Remove all elements of the set
+ */
+ void removeAllObjects();
/**
*@brief Check if CCSet contains a element equals pObject.
*/
diff --git a/cocos2dx/include/ccConfig.h b/cocos2dx/include/ccConfig.h
index af8b942fc7..b558a50003 100644
--- a/cocos2dx/include/ccConfig.h
+++ b/cocos2dx/include/ccConfig.h
@@ -107,7 +107,7 @@ To enabled set it to 1. Disabled by default.
Default value: 0.1f
*/
#ifndef CC_DIRECTOR_STATS_INTERVAL
-#define CC_DIRECTOR_STATS_INTERVAL (0.1f)
+#define CC_DIRECTOR_STATS_INTERVAL (0.5f)
#endif
/** @def CC_DIRECTOR_FPS_POSITION
diff --git a/cocos2dx/misc_nodes/CCRenderTexture.cpp b/cocos2dx/misc_nodes/CCRenderTexture.cpp
index 51044cc47c..87831a422f 100644
--- a/cocos2dx/misc_nodes/CCRenderTexture.cpp
+++ b/cocos2dx/misc_nodes/CCRenderTexture.cpp
@@ -59,12 +59,19 @@ CCRenderTexture::CCRenderTexture()
, m_nClearStencil(0)
, m_bAutoDraw(false)
{
+#if CC_ENABLE_CACHE_TEXTURE_DATA
// Listen this event to save render texture before come to background.
// Then it can be restored after coming to foreground on Android.
CCNotificationCenter::sharedNotificationCenter()->addObserver(this,
- callfuncO_selector(CCRenderTexture::listenToBackground),
- EVENT_COME_TO_BACKGROUND,
- NULL);
+ callfuncO_selector(CCRenderTexture::listenToBackground),
+ EVENT_COME_TO_BACKGROUND,
+ NULL);
+
+ CCNotificationCenter::sharedNotificationCenter()->addObserver(this,
+ callfuncO_selector(CCRenderTexture::listenToForeground),
+ EVNET_COME_TO_FOREGROUND, // this is misspelt
+ NULL);
+#endif
}
CCRenderTexture::~CCRenderTexture()
@@ -78,29 +85,59 @@ CCRenderTexture::~CCRenderTexture()
glDeleteRenderbuffers(1, &m_uDepthRenderBufffer);
}
CC_SAFE_DELETE(m_pUITextureImage);
-
+
+#if CC_ENABLE_CACHE_TEXTURE_DATA
CCNotificationCenter::sharedNotificationCenter()->removeObserver(this, EVENT_COME_TO_BACKGROUND);
+ CCNotificationCenter::sharedNotificationCenter()->removeObserver(this, EVNET_COME_TO_FOREGROUND);
+#endif
}
void CCRenderTexture::listenToBackground(cocos2d::CCObject *obj)
{
#if CC_ENABLE_CACHE_TEXTURE_DATA
-
CC_SAFE_DELETE(m_pUITextureImage);
// to get the rendered texture data
- m_pUITextureImage = newCCImage();
-
+ m_pUITextureImage = newCCImage(false);
if (m_pUITextureImage)
{
const CCSize& s = m_pTexture->getContentSizeInPixels();
VolatileTexture::addDataTexture(m_pTexture, m_pUITextureImage->getData(), kTexture2DPixelFormat_RGBA8888, s);
- }
+
+ if ( m_pTextureCopy )
+ {
+ VolatileTexture::addDataTexture(m_pTextureCopy, m_pUITextureImage->getData(), kTexture2DPixelFormat_RGBA8888, s);
+ }
+ }
else
{
CCLOG("Cache rendertexture failed!");
}
+
+ glDeleteFramebuffers(1, &m_uFBO);
+ m_uFBO = 0;
+#endif
+}
+
+void CCRenderTexture::listenToForeground(cocos2d::CCObject *obj)
+{
+#if CC_ENABLE_CACHE_TEXTURE_DATA
+ // -- regenerate frame buffer object and attach the texture
+ glGetIntegerv(GL_FRAMEBUFFER_BINDING, &m_nOldFBO);
+
+ glGenFramebuffers(1, &m_uFBO);
+ glBindFramebuffer(GL_FRAMEBUFFER, m_uFBO);
+
+ m_pTexture->setAliasTexParameters();
+
+ if ( m_pTextureCopy )
+ {
+ m_pTextureCopy->setAliasTexParameters();
+ }
+
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_pTexture->getName(), 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, m_nOldFBO);
#endif
}
@@ -590,7 +627,7 @@ bool CCRenderTexture::saveToFile(const char *szFilePath)
{
bool bRet = false;
- CCImage *pImage = newCCImage();
+ CCImage *pImage = newCCImage(true);
if (pImage)
{
bRet = pImage->saveToFile(szFilePath, kCCImageFormatJPEG);
@@ -605,7 +642,7 @@ bool CCRenderTexture::saveToFile(const char *fileName, tCCImageFormat format)
CCAssert(format == kCCImageFormatJPEG || format == kCCImageFormatPNG,
"the image can only be saved as JPG or PNG format");
- CCImage *pImage = newCCImage();
+ CCImage *pImage = newCCImage(true);
if (pImage)
{
std::string fullpath = CCFileUtils::sharedFileUtils()->getWriteablePath() + fileName;
@@ -619,7 +656,7 @@ bool CCRenderTexture::saveToFile(const char *fileName, tCCImageFormat format)
}
/* get buffer as CCImage */
-CCImage* CCRenderTexture::newCCImage()
+CCImage* CCRenderTexture::newCCImage(bool flipImage)
{
CCAssert(m_ePixelFormat == kCCTexture2DPixelFormat_RGBA8888, "only RGBA8888 can be saved as image");
@@ -656,16 +693,24 @@ CCImage* CCRenderTexture::newCCImage()
glReadPixels(0,0,nSavedBufferWidth, nSavedBufferHeight,GL_RGBA,GL_UNSIGNED_BYTE, pTempData);
this->end();
- // to get the actual texture data
- // #640 the image read from rendertexture is dirty
- for (int i = 0; i < nSavedBufferHeight; ++i)
+ if ( flipImage ) // -- flip is only required when saving image to file
{
- memcpy(&pBuffer[i * nSavedBufferWidth * 4],
- &pTempData[(nSavedBufferHeight - i - 1) * nSavedBufferWidth * 4],
- nSavedBufferWidth * 4);
- }
+ // to get the actual texture data
+ // #640 the image read from rendertexture is dirty
+ for (int i = 0; i < nSavedBufferHeight; ++i)
+ {
+ memcpy(&pBuffer[i * nSavedBufferWidth * 4],
+ &pTempData[(nSavedBufferHeight - i - 1) * nSavedBufferWidth * 4],
+ nSavedBufferWidth * 4);
+ }
- pImage->initWithImageData(pBuffer, nSavedBufferWidth * nSavedBufferHeight * 4, CCImage::kFmtRawData, nSavedBufferWidth, nSavedBufferHeight, 8);
+ pImage->initWithImageData(pBuffer, nSavedBufferWidth * nSavedBufferHeight * 4, CCImage::kFmtRawData, nSavedBufferWidth, nSavedBufferHeight, 8);
+ }
+ else
+ {
+ pImage->initWithImageData(pTempData, nSavedBufferWidth * nSavedBufferHeight * 4, CCImage::kFmtRawData, nSavedBufferWidth, nSavedBufferHeight, 8);
+ }
+
} while (0);
CC_SAFE_DELETE_ARRAY(pBuffer);
diff --git a/cocos2dx/misc_nodes/CCRenderTexture.h b/cocos2dx/misc_nodes/CCRenderTexture.h
index 26aff3e68d..313cd67d19 100644
--- a/cocos2dx/misc_nodes/CCRenderTexture.h
+++ b/cocos2dx/misc_nodes/CCRenderTexture.h
@@ -128,7 +128,7 @@ public:
/* creates a new CCImage from with the texture's data.
Caller is responsible for releasing it by calling delete.
*/
- CCImage* newCCImage();
+ CCImage* newCCImage(bool flipImage = true);
/** saves the texture into a file using JPEG format. The file will be saved in the Documents folder.
Returns YES if the operation is successful.
@@ -145,6 +145,11 @@ public:
*/
void listenToBackground(CCObject *obj);
+ /** Listen "come to foreground" message and restore the frame buffer object
+ It only has effect on Android.
+ */
+ void listenToForeground(CCObject *obj);
+
/** Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT. They can be OR'ed. Valid when "autoDraw is YES. */
unsigned int getClearFlags() const;
void setClearFlags(unsigned int uClearFlags);
diff --git a/cocos2dx/platform/CCCommon.h b/cocos2dx/platform/CCCommon.h
index 0ac1f5b754..72340ee036 100644
--- a/cocos2dx/platform/CCCommon.h
+++ b/cocos2dx/platform/CCCommon.h
@@ -64,7 +64,9 @@ typedef enum LanguageType
kLanguageGerman,
kLanguageSpanish,
kLanguageRussian,
- kLanguageKorean
+ kLanguageKorean,
+ kLanguageJapanese,
+ kLanguageHungarian
} ccLanguageType;
// end of platform group
diff --git a/cocos2dx/platform/android/CCApplication.cpp b/cocos2dx/platform/android/CCApplication.cpp
index 2d2a76047a..67b9b42e01 100644
--- a/cocos2dx/platform/android/CCApplication.cpp
+++ b/cocos2dx/platform/android/CCApplication.cpp
@@ -112,6 +112,14 @@ ccLanguageType CCApplication::getCurrentLanguage()
{
ret = kLanguageKorean;
}
+ else if (0 == strcmp("ja", pLanguageName))
+ {
+ ret = kLanguageJapanese;
+ }
+ else if (0 == strcmp("hu", pLanguageName))
+ {
+ ret = kLanguageHungarian;
+ }
return ret;
}
diff --git a/cocos2dx/platform/blackberry/CCApplication.cpp b/cocos2dx/platform/blackberry/CCApplication.cpp
index 5efe65864c..f855796735 100644
--- a/cocos2dx/platform/blackberry/CCApplication.cpp
+++ b/cocos2dx/platform/blackberry/CCApplication.cpp
@@ -147,10 +147,18 @@ ccLanguageType CCApplication::getCurrentLanguage()
{
ret_language = kLanguageRussian;
}
- else if (strcmp(language, "ko") == 0)
+ else if (strcmp(language, "ko") == 0)
{
ret_language = kLanguageKorean;
}
+ else if (strcmp(language, "ja") == 0)
+ {
+ ret_language = kLanguageJapanese;
+ }
+ else if (strcmp(language, "hu") == 0)
+ {
+ ret_language = kLanguageHungarian;
+ }
free(language);
free(country);
diff --git a/cocos2dx/platform/ios/CCApplication.mm b/cocos2dx/platform/ios/CCApplication.mm
index 56233311d3..7927944b8d 100644
--- a/cocos2dx/platform/ios/CCApplication.mm
+++ b/cocos2dx/platform/ios/CCApplication.mm
@@ -107,6 +107,12 @@ ccLanguageType CCApplication::getCurrentLanguage()
else if ([languageCode isEqualToString:@"ko"]){
ret = kLanguageKorean;
}
+ else if ([languageCode isEqualToString:@"ja"]){
+ ret = kLanguageJapanese;
+ }
+ else if ([languageCode isEqualToString:@"hu"]){
+ ret = kLanguageHungarian;
+ }
return ret;
}
diff --git a/cocos2dx/platform/linux/CCApplication.cpp b/cocos2dx/platform/linux/CCApplication.cpp
index 86c2352c02..397b6f7ea9 100644
--- a/cocos2dx/platform/linux/CCApplication.cpp
+++ b/cocos2dx/platform/linux/CCApplication.cpp
@@ -100,8 +100,60 @@ CCApplication* CCApplication::sharedApplication()
ccLanguageType CCApplication::getCurrentLanguage()
{
- //TODO
- return kLanguageEnglish;
+ char *pLanguageName = getenv("LANG");
+ ccLanguageType ret = kLanguageEnglish;
+ if (!pLanguageName)
+ {
+ return kLanguageEnglish;
+ }
+ strtok(pLanguageName, "_");
+ if (!pLanguageName)
+ {
+ return kLanguageEnglish;
+ }
+
+ if (0 == strcmp("zh", pLanguageName))
+ {
+ ret = kLanguageChinese;
+ }
+ else if (0 == strcmp("en", pLanguageName))
+ {
+ ret = kLanguageEnglish;
+ }
+ else if (0 == strcmp("fr", pLanguageName))
+ {
+ ret = kLanguageFrench;
+ }
+ else if (0 == strcmp("it", pLanguageName))
+ {
+ ret = kLanguageItalian;
+ }
+ else if (0 == strcmp("de", pLanguageName))
+ {
+ ret = kLanguageGerman;
+ }
+ else if (0 == strcmp("es", pLanguageName))
+ {
+ ret = kLanguageSpanish;
+ }
+ else if (0 == strcmp("ru", pLanguageName))
+ {
+ ret = kLanguageRussian;
+ }
+ else if (0 == strcmp("ko", pLanguageName))
+ {
+ ret = kLanguageKorean;
+ }
+ else if (0 == strcmp("ja", pLanguageName))
+ {
+ ret = kLanguageJapanese;
+ }
+ else if (0 == strcmp("hu", pLanguageName))
+ {
+ ret = kLanguageHungarian;
+ }
+
+ return ret;
}
NS_CC_END
diff --git a/cocos2dx/platform/linux/CCEGLView.cpp b/cocos2dx/platform/linux/CCEGLView.cpp
index 6cabdcb5ac..75ca2e83cd 100644
--- a/cocos2dx/platform/linux/CCEGLView.cpp
+++ b/cocos2dx/platform/linux/CCEGLView.cpp
@@ -181,7 +181,7 @@ void CCEGLView::setFrameSize(float width, float height)
case 16:
{
/* Updates video mode */
- eResult = (glfwOpenWindow(width, height, 5, 6, 5, 0, 16, 0, (int)u32GLFWFlags) != false) ? true : false;
+ eResult = (glfwOpenWindow(width, height, 5, 6, 5, 0, 16, 8, (int)u32GLFWFlags) != false) ? true : false;
break;
}
@@ -190,7 +190,7 @@ void CCEGLView::setFrameSize(float width, float height)
case 24:
{
/* Updates video mode */
- eResult = (glfwOpenWindow(width, height, 8, 8, 8, 0, 16, 0, (int)u32GLFWFlags) != false) ? true : false;
+ eResult = (glfwOpenWindow(width, height, 8, 8, 8, 0, 16, 8, (int)u32GLFWFlags) != false) ? true : false;
break;
}
@@ -200,7 +200,7 @@ void CCEGLView::setFrameSize(float width, float height)
case 32:
{
/* Updates video mode */
- eResult = (glfwOpenWindow(width, height, 8, 8, 8, 8, 16, 0, (int)u32GLFWFlags) != GL_FALSE) ? true :false;
+ eResult = (glfwOpenWindow(width, height, 8, 8, 8, 8, 16, 8, (int)u32GLFWFlags) != GL_FALSE) ? true :false;
break;
}
}
@@ -320,6 +320,10 @@ bool CCEGLView::initGL()
{
CCLog("OpenGL 2.0 not supported\n");
}
+
+ // Enable point size by default on linux.
+ glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
+
return true;
}
diff --git a/cocos2dx/platform/mac/CCApplication.mm b/cocos2dx/platform/mac/CCApplication.mm
index 8c2a985d25..866fa1ba36 100755
--- a/cocos2dx/platform/mac/CCApplication.mm
+++ b/cocos2dx/platform/mac/CCApplication.mm
@@ -113,6 +113,12 @@ ccLanguageType CCApplication::getCurrentLanguage()
else if ([languageCode isEqualToString:@"ko"]){
ret = kLanguageKorean;
}
+ else if ([languageCode isEqualToString:@"ja"]){
+ ret = kLanguageJapanese;
+ }
+ else if ([languageCode isEqualToString:@"hu"]){
+ ret = kLanguageHungarian;
+ }
return ret;
}
diff --git a/cocos2dx/platform/marmalade/CCApplication.cpp b/cocos2dx/platform/marmalade/CCApplication.cpp
index 94e4d6e485..25370cea71 100644
--- a/cocos2dx/platform/marmalade/CCApplication.cpp
+++ b/cocos2dx/platform/marmalade/CCApplication.cpp
@@ -177,6 +177,14 @@ ccLanguageType CCApplication::getCurrentLanguage()
currentLanguage = kLanguageKorean;
break;
+ case S3E_DEVICE_LANGUAGE_JAPANESE:
+ currentLanguage = kLanguageJapanese;
+ break;
+
+ case S3E_DEVICE_LANGUAGE_HUNGARIAN:
+ currentLanguage = kLanguageHungarian;
+ break;
+
default:
currentLanguage = kLanguageEnglish;
break;
diff --git a/cocos2dx/platform/win32/CCApplication.cpp b/cocos2dx/platform/win32/CCApplication.cpp
index e46a242859..a774d350eb 100644
--- a/cocos2dx/platform/win32/CCApplication.cpp
+++ b/cocos2dx/platform/win32/CCApplication.cpp
@@ -139,6 +139,12 @@ ccLanguageType CCApplication::getCurrentLanguage()
case LANG_KOREAN:
ret = kLanguageKorean;
break;
+ case LANG_JAPANESE:
+ ret = kLanguageJapanese;
+ break;
+ case LANG_HUNGARIAN:
+ ret = kLanguageHungarian;
+ break;
}
return ret;
diff --git a/cocos2dx/proj.linux/.cproject b/cocos2dx/proj.linux/.cproject
index 15fc52aa60..9e0dbc0a23 100755
--- a/cocos2dx/proj.linux/.cproject
+++ b/cocos2dx/proj.linux/.cproject
@@ -86,13 +86,12 @@
-
@@ -106,10 +105,11 @@
-
+
+
@@ -217,12 +217,11 @@
-
@@ -236,10 +235,11 @@
-
+
+
@@ -251,6 +251,7 @@
+
diff --git a/cocos2dx/proj.linux/.project b/cocos2dx/proj.linux/.project
index 52dac3939c..ea9f34c306 100755
--- a/cocos2dx/proj.linux/.project
+++ b/cocos2dx/proj.linux/.project
@@ -101,11 +101,6 @@
1
PARENT-1-PROJECT_LOC/CCDirector.cpp
-
- CCDrawingPrimitives.cpp
- 1
- PARENT-1-PROJECT_LOC/CCDrawingPrimitives.cpp
-
CCScheduler.cpp
1
@@ -131,6 +126,11 @@
1
PARENT-1-PROJECT_LOC/cocos2d.cpp
+
+ draw_nodes
+ 2
+ PARENT-1-PROJECT_LOC/draw_nodes
+
effects
2
diff --git a/cocos2dx/proj.linux/Makefile b/cocos2dx/proj.linux/Makefile
index 14b2ca16a6..478b067126 100644
--- a/cocos2dx/proj.linux/Makefile
+++ b/cocos2dx/proj.linux/Makefile
@@ -174,7 +174,7 @@ SHAREDLIBS += -L../../cocos2dx/platform/third_party/linux/glew-1.7.0/glew-1.7.0/
debug: CCFLAGS += -g3 -O0
debug: CXXFLAGS += -g3 -O0
-debug: DEFINES += -DDEBUG -DCC_ENABLE_CHIPMUNK_INTEGRATION
+debug: DEFINES += -DDEBUG -DCC_ENABLE_CHIPMUNK_INTEGRATION -DCOCOS2D_DEBUG=1
debug: $(TARGET)
release: CCFLAGS += -O3
diff --git a/cocos2dx/shaders/ccShader_PositionColorLengthTexture_frag.h b/cocos2dx/shaders/ccShader_PositionColorLengthTexture_frag.h
index 80470e273c..803664a506 100644
--- a/cocos2dx/shaders/ccShader_PositionColorLengthTexture_frag.h
+++ b/cocos2dx/shaders/ccShader_PositionColorLengthTexture_frag.h
@@ -20,9 +20,9 @@
*/
" \n\
-#extension GL_OES_standard_derivatives : enable \n\
- \n\
#ifdef GL_ES \n\
+// #extension GL_OES_standard_derivatives : enable \n\
+ \n\
varying mediump vec4 v_color; \n\
varying mediump vec2 v_texcoord; \n\
#else \n\
@@ -32,10 +32,10 @@ varying vec2 v_texcoord; \n\
\n\
void main() \n\
{ \n\
-#if defined GL_OES_standard_derivatives \n\
- gl_FragColor = v_color*smoothstep(0.0, length(fwidth(v_texcoord)), 1.0 - length(v_texcoord)); \n\
-#else \n\
+// #if defined GL_OES_standard_derivatives \n\
+ // gl_FragColor = v_color*smoothstep(0.0, length(fwidth(v_texcoord)), 1.0 - length(v_texcoord)); \n\
+// #else \n\
gl_FragColor = v_color*step(0.0, 1.0 - length(v_texcoord)); \n\
-#endif \n\
+// #endif \n\
} \n\
";
diff --git a/document/doxygen.config b/document/doxygen.config
index af4736f0e6..5adc36c084 100644
--- a/document/doxygen.config
+++ b/document/doxygen.config
@@ -32,7 +32,7 @@ PROJECT_NAME = cocos2d-x
# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER = 2.0.3
+PROJECT_NUMBER = 2.1.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
@@ -676,12 +676,11 @@ WARN_LOGFILE =
# with spaces.
INPUT = ../cocos2dx \
- ../cocos2dx/platform \
- ../CocosDenshion/include \
+ ../cocos2dx/platform \
+ ../CocosDenshion/include \
../document \
../extensions \
- ../scripting/lua/cocos2dx_support \
-
+ ../scripting/lua/cocos2dx_support
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
diff --git a/extensions/CCBReader/CCBReader.cpp b/extensions/CCBReader/CCBReader.cpp
index 8cb0211fc6..5586b32225 100644
--- a/extensions/CCBReader/CCBReader.cpp
+++ b/extensions/CCBReader/CCBReader.cpp
@@ -134,9 +134,9 @@ CCBReader::~CCBReader() {
this->mCCNodeLoaderLibrary->release();
- mOwnerOutletNodes->release();
- mOwnerOutletNames.clear();
- mOwnerCallbackNodes->release();
+ mOwnerOutletNodes->release();
+ mOwnerOutletNames.clear();
+ mOwnerCallbackNodes->release();
mOwnerCallbackNames.clear();
// Clear string cache.
@@ -292,13 +292,13 @@ CCNode* CCBReader::readNodeGraphFromData(CCData *pData, CCObject *pOwner, const
CCDICT_FOREACH(animationManagers, pElement)
{
CCNode* pNode = (CCNode*)pElement->getIntKey();
- CCBAnimationManager* manager = (CCBAnimationManager*)animationManagers->objectForKey((intptr_t)pNode);
- pNode->setUserObject(manager);
-
- if (jsControlled)
- {
- mNodesWithAnimationManagers->addObject(pNode);
- mAnimationManagersForNodes->addObject(manager);
+ CCBAnimationManager* manager = (CCBAnimationManager*)animationManagers->objectForKey((intptr_t)pNode);
+ pNode->setUserObject(manager);
+
+ if (jsControlled)
+ {
+ mNodesWithAnimationManagers->addObject(pNode);
+ mAnimationManagersForNodes->addObject(manager);
}
}
@@ -414,24 +414,24 @@ bool CCBReader::readBool() {
return 0 == this->readByte() ? false : true;
}
-std::string CCBReader::readUTF8()
-{
- std::string ret;
-
- int b0 = this->readByte();
- int b1 = this->readByte();
-
- int numBytes = b0 << 8 | b1;
-
- char* pStr = (char*)malloc(numBytes+1);
- memcpy(pStr, mBytes+mCurrentByte, numBytes);
- pStr[numBytes] = '\0';
- ret = pStr;
- free(pStr);
-
- mCurrentByte += numBytes;
-
- return ret;
+std::string CCBReader::readUTF8()
+{
+ std::string ret;
+
+ int b0 = this->readByte();
+ int b1 = this->readByte();
+
+ int numBytes = b0 << 8 | b1;
+
+ char* pStr = (char*)malloc(numBytes+1);
+ memcpy(pStr, mBytes+mCurrentByte, numBytes);
+ pStr[numBytes] = '\0';
+ ret = pStr;
+ free(pStr);
+
+ mCurrentByte += numBytes;
+
+ return ret;
}
bool CCBReader::getBit() {
@@ -908,15 +908,7 @@ CCArray* CCBReader::getAnimationManagersForNodes() {
float CCBReader::getResolutionScale()
{
- // Init resolution scale
- if (CCApplication::sharedApplication()->getTargetPlatform() == kTargetIpad)
- {
- return 2;
- }
- else
- {
- return 1;
- }
+ return 1;
}
NS_CC_EXT_END;
diff --git a/external/chipmunk/include/chipmunk/chipmunk_types.h b/external/chipmunk/include/chipmunk/chipmunk_types.h
index 03ef6b5be6..5124d4868f 100644
--- a/external/chipmunk/include/chipmunk/chipmunk_types.h
+++ b/external/chipmunk/include/chipmunk/chipmunk_types.h
@@ -1,4 +1,4 @@
-//#include
+#include
#ifdef __APPLE__
#include "TargetConditionals.h"
diff --git a/samples/CocosDragonJS/Classes/AppDelegate.cpp b/samples/CocosDragonJS/Classes/AppDelegate.cpp
index 45305b9db6..5f35c9fabb 100644
--- a/samples/CocosDragonJS/Classes/AppDelegate.cpp
+++ b/samples/CocosDragonJS/Classes/AppDelegate.cpp
@@ -25,18 +25,32 @@ bool AppDelegate::applicationDidFinishLaunching()
// initialize director
CCDirector *pDirector = CCDirector::sharedDirector();
pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
+ pDirector->setProjection(kCCDirectorProjection2D);
CCSize screenSize = CCEGLView::sharedOpenGLView()->getFrameSize();
CCSize designSize = CCSizeMake(320, 480);
+ CCSize resourceSize = CCSizeMake(320, 480);
-// if (screenSize.height > 320)
-// {
-// CCSize resourceSize = CCSizeMake(640, 960);
-// CCFileUtils::sharedFileUtils()->setResourceDirectory("hd");
-// pDirector->setContentScaleFactor(resourceSize.height/designSize.height);
-// }
+ if (screenSize.height > 768)
+ {
+ resourceSize = CCSizeMake(1536, 2048);
+ CCFileUtils::sharedFileUtils()->setResourceDirectory("resources-ipadhd");
+ }
+ else if (screenSize.height > 640)
+ {
+ resourceSize = CCSizeMake(768, 1536);
+ CCFileUtils::sharedFileUtils()->setResourceDirectory("resources-ipad");
+ }
+ else if (screenSize.height > 320)
+ {
+ resourceSize = CCSizeMake(640, 960);
+ CCFileUtils::sharedFileUtils()->setResourceDirectory("resources-iphonehd");
+
+ }
+
+ pDirector->setContentScaleFactor(resourceSize.height/designSize.height);
CCEGLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionNoBorder);
diff --git a/samples/CocosDragonJS/proj.ios/CocosDragonJS.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/CocosDragonJS/proj.ios/CocosDragonJS.xcodeproj/project.pbxproj.REMOVED.git-id
new file mode 100644
index 0000000000..4f0122bc2b
--- /dev/null
+++ b/samples/CocosDragonJS/proj.ios/CocosDragonJS.xcodeproj/project.pbxproj.REMOVED.git-id
@@ -0,0 +1 @@
+c445ba0cb7d4f6fdba3cce049e727fc39bd9b44e
\ No newline at end of file
diff --git a/samples/HelloCpp/Resources/development.icf b/samples/HelloCpp/Resources/development.icf
new file mode 100644
index 0000000000..97a05645d0
--- /dev/null
+++ b/samples/HelloCpp/Resources/development.icf
@@ -0,0 +1,107 @@
+# Settings ICF file automatically generated by S3E development environment
+
+AccelEnabled = Type=bool, Default="true", Value = "true"
+AudioAAC = Type=bool, Default="false", Value = "false"
+AudioAACPlus = Type=bool, Default="false", Value = "false"
+AudioMIDI = Type=bool, Default="true", Value = "true"
+AudioMP3 = Type=bool, Default="true", Value = "true"
+AudioPCM = Type=bool, Default="true", Value = "true"
+AudioQCP = Type=bool, Default="false", Value = "false"
+AudioVolumeDefault = Type=int, Min=0.000000, Max=256.000000, Default="256", Value = "256"
+BacklightTimeout = Type=int, Min=0.000000, Max=120000.000000, Default="10000", Value = "10000"
+CompassEnabled = Type=bool, Default="true", Value = "true"
+ContactsFromAddrBook = Type=bool, Default="false", Value = "false"
+DeviceAdvanceSoftkeyPosition = Type=string, Allowed="Bottom Left" "Bottom Right" "Top Right" "Top Left", Default="Bottom Left", Value = "Bottom Left"
+DeviceArch = Type=string, Allowed="