From f056757a9f114f60cb26b2ecc186bf57dee6ff96 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 6 Jun 2013 14:16:57 +0800 Subject: [PATCH 1/9] Adding libwebsockets license in WebSocket.h/.cpp. --- extensions/network/WebSocket.cpp | 4 ++++ extensions/network/WebSocket.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/extensions/network/WebSocket.cpp b/extensions/network/WebSocket.cpp index 93ecea4157..b12f5d3922 100644 --- a/extensions/network/WebSocket.cpp +++ b/extensions/network/WebSocket.cpp @@ -21,6 +21,10 @@ 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. + +"[WebSocket module] is based in part on the work of the libwebsockets project +(http://libwebsockets.org)" + ****************************************************************************/ #include "WebSocket.h" diff --git a/extensions/network/WebSocket.h b/extensions/network/WebSocket.h index 068f341d60..e764e16704 100644 --- a/extensions/network/WebSocket.h +++ b/extensions/network/WebSocket.h @@ -21,6 +21,10 @@ 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. + +"[WebSocket module] is based in part on the work of the libwebsockets project +(http://libwebsockets.org)" + ****************************************************************************/ #ifndef __CC_WEBSOCKET_H__ From 359225806bd286f93bdec7215323e0a274ccd2df Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 6 Jun 2013 14:19:16 +0800 Subject: [PATCH 2/9] Log error instead of triggering an assert for shadow and stroke. --- cocos2dx/label_nodes/CCLabelTTF.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cocos2dx/label_nodes/CCLabelTTF.cpp b/cocos2dx/label_nodes/CCLabelTTF.cpp index b96cf7d3f8..dd375118b1 100644 --- a/cocos2dx/label_nodes/CCLabelTTF.cpp +++ b/cocos2dx/label_nodes/CCLabelTTF.cpp @@ -355,7 +355,7 @@ void CCLabelTTF::enableShadow(const CCSize &shadowOffset, float shadowOpacity, f } #else - CCAssert(false, "Currently only supported on iOS and Android!"); + CCLOGERROR("Currently only supported on iOS and Android!"); #endif } @@ -374,7 +374,7 @@ void CCLabelTTF::disableShadow(bool updateTexture) } #else - CCAssert(false, "Currently only supported on iOS and Android!"); + CCLOGERROR("Currently only supported on iOS and Android!"); #endif } @@ -408,7 +408,7 @@ void CCLabelTTF::enableStroke(const ccColor3B &strokeColor, float strokeSize, bo } #else - CCAssert(false, "Currently only supported on iOS and Android!"); + CCLOGERROR("Currently only supported on iOS and Android!"); #endif } @@ -426,7 +426,7 @@ void CCLabelTTF::disableStroke(bool updateTexture) } #else - CCAssert(false, "Currently only supported on iOS and Android!"); + CCLOGERROR("Currently only supported on iOS and Android!"); #endif } @@ -442,7 +442,7 @@ void CCLabelTTF::setFontFillColor(const ccColor3B &tintColor, bool updateTexture this->updateTexture(); } #else - CCAssert(false, "Currently only supported on iOS and Android!"); + CCLOGERROR("Currently only supported on iOS and Android!"); #endif } From 0248c23b20203a0ec3c6c4f7ed168905b26a9c23 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 6 Jun 2013 14:19:59 +0800 Subject: [PATCH 3/9] [Mamarlade] Fixing a compilation error in cocos2dx/platform/marmalade/CCImage.cpp. --- cocos2dx/platform/marmalade/CCImage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2dx/platform/marmalade/CCImage.cpp b/cocos2dx/platform/marmalade/CCImage.cpp index 96e6da535d..930fe578b9 100644 --- a/cocos2dx/platform/marmalade/CCImage.cpp +++ b/cocos2dx/platform/marmalade/CCImage.cpp @@ -579,7 +579,7 @@ bool CCImage::initWithImageData(void * pData, } else if (kFmtRawData == eFmt) { - bRet = _initWithRawData(pData, nDataLen, nWidth, nHeight, nBitsPerComponent); + bRet = _initWithRawData(pData, nDataLen, nWidth, nHeight, nBitsPerComponent, false); break; } else @@ -1074,7 +1074,7 @@ bool CCImage::_initWithTiffData(void* pData, int nDataLen) return bRet; } -bool CCImage::_initWithRawData(void * pData, int nDatalen, int nWidth, int nHeight, int nBitsPerComponent) +bool CCImage::_initWithRawData(void * pData, int nDatalen, int nWidth, int nHeight, int nBitsPerComponent, bool bPreMulti) { bool bRet = false; do From b462c9de82ca531ae26e66159bdd3956d4902ac3 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 6 Jun 2013 14:22:09 +0800 Subject: [PATCH 4/9] Fixing a bug that display is wrong when setting setTexture(NULL) for CCSprite. --- cocos2dx/sprite_nodes/CCSprite.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cocos2dx/sprite_nodes/CCSprite.cpp b/cocos2dx/sprite_nodes/CCSprite.cpp index b0dea7ca5a..900a2bf97c 100644 --- a/cocos2dx/sprite_nodes/CCSprite.cpp +++ b/cocos2dx/sprite_nodes/CCSprite.cpp @@ -153,8 +153,6 @@ bool CCSprite::initWithTexture(CCTexture2D *pTexture, const CCRect& rect, bool r if (CCNodeRGBA::init()) { m_pobBatchNode = NULL; - // shader program - setShaderProgram(CCShaderCache::sharedShaderCache()->programForKey(kCCShader_PositionTextureColor)); m_bRecursiveDirty = false; setDirty(false); @@ -1085,6 +1083,16 @@ void CCSprite::setTexture(CCTexture2D *texture) // accept texture==nil as argument CCAssert( !texture || dynamic_cast(texture), "setTexture expects a CCTexture2D. Invalid argument"); + // shader program + if (texture) + { + setShaderProgram(CCShaderCache::sharedShaderCache()->programForKey(kCCShader_PositionTextureColor)); + } + else + { + setShaderProgram(CCShaderCache::sharedShaderCache()->programForKey(kCCShader_PositionColor)); + } + if (!m_pobBatchNode && m_pobTexture != texture) { CC_SAFE_RETAIN(texture); From 93597a5858d5e5e3bfcf63c67438f9c06fa9e614 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 6 Jun 2013 14:22:51 +0800 Subject: [PATCH 5/9] [Spine] Using getContentSize to make spine-runtime supports the strategy of loading resources in cocos2d-x. --- extensions/spine/spine-cocos2dx.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extensions/spine/spine-cocos2dx.cpp b/extensions/spine/spine-cocos2dx.cpp index bcb2394116..bfbc93d99d 100644 --- a/extensions/spine/spine-cocos2dx.cpp +++ b/extensions/spine/spine-cocos2dx.cpp @@ -35,8 +35,11 @@ void _AtlasPage_createTexture (AtlasPage* self, const char* path) { CCTextureAtlas* textureAtlas = CCTextureAtlas::createWithTexture(texture, 4); textureAtlas->retain(); self->rendererObject = textureAtlas; - self->width = texture->getPixelsWide(); - self->height = texture->getPixelsHigh(); + // Using getContentSize to make it supports the strategy of loading resources in cocos2d-x. + // self->width = texture->getPixelsWide(); + // self->height = texture->getPixelsHigh(); + self->width = texture->getContentSize().width; + self->height = texture->getContentSize().height; } void _AtlasPage_disposeTexture (AtlasPage* self) { From 8c3b1899bb5b3569078bf56e98a1eb92bc73e7e5 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 6 Jun 2013 14:23:30 +0800 Subject: [PATCH 6/9] Removing unreadable print in CCBReaderLoad.lua. --- scripting/lua/script/CCBReaderLoad.lua | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/scripting/lua/script/CCBReaderLoad.lua b/scripting/lua/script/CCBReaderLoad.lua index 3294f560af..afe3c3060d 100644 --- a/scripting/lua/script/CCBReaderLoad.lua +++ b/scripting/lua/script/CCBReaderLoad.lua @@ -4,15 +4,14 @@ function CCBReaderLoad(strFilePath,proxy,bSetOwner,strOwnerName) if nil == proxy then return end - local strFmt = string.format("%p",proxy) - print(strFmt) + local ccbReader = proxy:createCCBReader() local node = proxy:readCCBFromFile(strFilePath,ccbReader,bSetOwner) local owner = ccbReader:getOwner() local rootName = "" --owner set in readCCBFromFile is proxy if nil ~= owner then - print("come in owner") + --Callbacks local ownerCallbackNames = tolua.cast(ccbReader:getOwnerCallbackNames(),"CCArray") local ownerCallbackNodes = tolua.cast(ccbReader:getOwnerCallbackNodes(),"CCArray") @@ -28,11 +27,11 @@ function CCBReaderLoad(strFilePath,proxy,bSetOwner,strOwnerName) --Variables local ownerOutletNames = tolua.cast(ccbReader:getOwnerOutletNames(),"CCArray") local ownerOutletNodes = tolua.cast(ccbReader:getOwnerOutletNodes(),"CCArray") - print(ownerOutletNames:count()) + for i = 1, ownerOutletNames:count() do local outletName = tolua.cast(ownerOutletNames:objectAtIndex(i - 1),"CCString") local outletNode = tolua.cast(ownerOutletNodes:objectAtIndex(i - 1),"CCNode") - print(outletName:getCString()) + if "" ~= strOwnerName and nil ~= ccb[strOwnerName] then ccb[strOwnerName][outletName:getCString()] = outletNode end @@ -41,8 +40,7 @@ function CCBReaderLoad(strFilePath,proxy,bSetOwner,strOwnerName) local nodesWithAnimationManagers = tolua.cast(ccbReader:getNodesWithAnimationManagers(),"CCArray") local animationManagersForNodes = tolua.cast(ccbReader:getAnimationManagersForNodes(),"CCArray") - print("Test count") - print(nodesWithAnimationManagers:count()) + for i = 1 , nodesWithAnimationManagers:count() do local innerNode = tolua.cast(nodesWithAnimationManagers:objectAtIndex(i - 1),"CCNode") local animationManager = tolua.cast(animationManagersForNodes:objectAtIndex(i - 1),"CCBAnimationManager") @@ -57,13 +55,11 @@ function CCBReaderLoad(strFilePath,proxy,bSetOwner,strOwnerName) --Callbacks local documentCallbackNames = tolua.cast(animationManager:getDocumentCallbackNames(),"CCArray") local documentCallbackNodes = tolua.cast(animationManager:getDocumentCallbackNodes(),"CCArray") - print(documentControllerName) - print(documentCallbackNames:count()) + for i = 1,documentCallbackNames:count() do local callbackName = tolua.cast(documentCallbackNames:objectAtIndex(i - 1),"CCString") local callbackNode = tolua.cast(documentCallbackNodes:objectAtIndex(i - 1),"CCNode") if "" ~= documentControllerName and nil ~= ccb[documentControllerName] then - print(callbackName:getCString()) proxy:setCallback(callbackNode,ccb[documentControllerName][callbackName:getCString()]) end end @@ -71,11 +67,11 @@ function CCBReaderLoad(strFilePath,proxy,bSetOwner,strOwnerName) --Variables local documentOutletNames = tolua.cast(animationManager:getDocumentOutletNames(),"CCArray") local documentOutletNodes = tolua.cast(animationManager:getDocumentOutletNodes(),"CCArray") - print(documentOutletNames:count()) + for i = 1, documentOutletNames:count() do local outletName = tolua.cast(documentOutletNames:objectAtIndex(i - 1),"CCString") local outletNode = tolua.cast(documentOutletNodes:objectAtIndex(i - 1),"CCNode") - print(outletName:getCString()) + if nil ~= ccb[documentControllerName] then ccb[documentControllerName][outletName:getCString()] = outletNode end @@ -86,14 +82,14 @@ function CCBReaderLoad(strFilePath,proxy,bSetOwner,strOwnerName) ]]-- --Setup timeline callbacks local keyframeCallbacks = animationManager:getKeyframeCallbacks() - print(keyframeCallbacks:count()) + for i = 1 , keyframeCallbacks:count() do local callbackCombine = tolua.cast(keyframeCallbacks:objectAtIndex(i - 1),"CCString"):getCString() local beignIndex,endIndex = string.find(callbackCombine,":") local callbackType = tonumber(string.sub(callbackCombine,1,beignIndex - 1)) local callbackName = string.sub(callbackCombine,endIndex + 1, -1) --Document callback - print(callbackName) + if 1 == callbackType and nil ~= ccb[documentControllerName] then local callfunc = CCCallFunc:create(ccb[documentControllerName][callbackName]) animationManager:setCallFuncForLuaCallbackNamed(callfunc, callbackCombine); From f22d3207979fe0750b9489a2e443cc21ffb29693 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 6 Jun 2013 14:24:58 +0800 Subject: [PATCH 7/9] Removing CODE_SIGN_IDETITY section in prom.pbxproj. --- .../proj.ios/HelloSocial.xcodeproj/project.pbxproj | 4 ---- .../proj.ios/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- .../proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- .../HelloCpp.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- .../HelloCpp.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/plugin/samples/HelloSocial/proj.ios/HelloSocial.xcodeproj/project.pbxproj b/plugin/samples/HelloSocial/proj.ios/HelloSocial.xcodeproj/project.pbxproj index 567a9e2c85..013e0d1172 100644 --- a/plugin/samples/HelloSocial/proj.ios/HelloSocial.xcodeproj/project.pbxproj +++ b/plugin/samples/HelloSocial/proj.ios/HelloSocial.xcodeproj/project.pbxproj @@ -517,8 +517,6 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CODE_SIGN_IDENTITY = "iPhone Developer: 小明 张 (L4ZF355VQS)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: 小明 张 (L4ZF355VQS)"; GCC_C_LANGUAGE_STANDARD = c99; GCC_VERSION = ""; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -534,8 +532,6 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CODE_SIGN_IDENTITY = "iPhone Developer: 小明 张 (L4ZF355VQS)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: 小明 张 (L4ZF355VQS)"; GCC_C_LANGUAGE_STANDARD = c99; GCC_VERSION = ""; GCC_WARN_ABOUT_RETURN_TYPE = YES; diff --git a/samples/Cpp/TestCpp/proj.ios/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/Cpp/TestCpp/proj.ios/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id index 071ada9c94..e696f2c65d 100644 --- a/samples/Cpp/TestCpp/proj.ios/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/Cpp/TestCpp/proj.ios/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -a606a7cb80629a1b2ca56c0100155d44765d42f5 \ No newline at end of file +07885cfba05880900d4e0ae9462ad3fc92ebe359 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id index 4ada33c054..498c21f53b 100644 --- a/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -f586581454edb9506a141c21bbed73c3cd95a3b4 \ No newline at end of file +8edebf9f78abdc56b67b1983b046185cc0aeb507 \ No newline at end of file diff --git a/template/multi-platform-cpp/proj.ios/HelloCpp.xcodeproj/project.pbxproj.REMOVED.git-id b/template/multi-platform-cpp/proj.ios/HelloCpp.xcodeproj/project.pbxproj.REMOVED.git-id index 034ea11014..1a89b28a4a 100644 --- a/template/multi-platform-cpp/proj.ios/HelloCpp.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/template/multi-platform-cpp/proj.ios/HelloCpp.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -e181564942f6b73968ac0b9611605cf8c730afe1 \ No newline at end of file +9bc5d539e1924d8598991cc1ccf1d2732f07d1c7 \ No newline at end of file diff --git a/template/multi-platform-cpp/proj.mac/HelloCpp.xcodeproj/project.pbxproj.REMOVED.git-id b/template/multi-platform-cpp/proj.mac/HelloCpp.xcodeproj/project.pbxproj.REMOVED.git-id index 87001457ba..aced293857 100644 --- a/template/multi-platform-cpp/proj.mac/HelloCpp.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/template/multi-platform-cpp/proj.mac/HelloCpp.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -8d35329da35337497a9d91e86e817784b76a0df5 \ No newline at end of file +aa20ec528e346e28c1e7dd191158edf0f53f14ee \ No newline at end of file From ed4b9b2bb33f982cae9e88bc212aa9c88ea230a4 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 6 Jun 2013 14:26:35 +0800 Subject: [PATCH 8/9] Marmalade projects fix. --- extensions/proj.marmalade/cocos2dx-ext.mkf | 2 +- samples/Cpp/TestCpp/Resources/app.icf | 2 +- samples/Cpp/TestCpp/Resources/development.icf | 18 +++++++++--------- samples/Cpp/TestCpp/proj.marmalade/TestCPP.mkb | 8 ++++---- samples/Lua/HelloLua/Resources/development.icf | 4 ++-- .../Lua/HelloLua/proj.marmalade/HelloLua.mkb | 9 ++++++++- samples/Lua/TestLua/Resources/development.icf | 4 ++-- samples/Lua/TestLua/proj.marmalade/TestLua.mkb | 4 ++-- 8 files changed, 29 insertions(+), 22 deletions(-) diff --git a/extensions/proj.marmalade/cocos2dx-ext.mkf b/extensions/proj.marmalade/cocos2dx-ext.mkf index 1d77650147..1c53e0a493 100644 --- a/extensions/proj.marmalade/cocos2dx-ext.mkf +++ b/extensions/proj.marmalade/cocos2dx-ext.mkf @@ -36,7 +36,7 @@ files ("../GUI/CCEditBox") "CCEditBox.h" "CCEditBox.cpp" - “CCEditBoxImplNone.cpp” + "CCEditBoxImplNone.cpp" ["GUI/CCScrollView"] ("../GUI/CCScrollView") diff --git a/samples/Cpp/TestCpp/Resources/app.icf b/samples/Cpp/TestCpp/Resources/app.icf index dbc72b4d77..7fdabcd1f2 100644 --- a/samples/Cpp/TestCpp/Resources/app.icf +++ b/samples/Cpp/TestCpp/Resources/app.icf @@ -16,7 +16,7 @@ # Some conditional operations are also permitted, see the # S3E documentation for details. [S3E] -MemSize = 10000000 +MemSize = 100000000 # Sample only compatible with 480x320 display resolution WinWidth=480 WinHeight=320 diff --git a/samples/Cpp/TestCpp/Resources/development.icf b/samples/Cpp/TestCpp/Resources/development.icf index c670b09718..363d486f04 100644 --- a/samples/Cpp/TestCpp/Resources/development.icf +++ b/samples/Cpp/TestCpp/Resources/development.icf @@ -19,13 +19,13 @@ DeviceClass = Type=string, Allowed="UNKNOWN" "SYMBIAN_GENERIC DeviceFPU = Type=string, Allowed="None" "VFP Present", Default="VFP Present", Value = "VFP Present" DeviceFreeRAM = Type=int, Min=0.000000, Max=2097151.000000, Default="1048576", Value = "1048576" DeviceIDInt = Type=int, Default="0", Value = "0" -DeviceIDString = Type=string, Default="", Value = "" +DeviceIDString = Type=string, Default="", Value = "Samsung Galaxy S" DeviceIMSI = Type=string, Default="SIMULATOR_IMSI", Value = "SIMULATOR_IMSI" DeviceLSKIsBack = Type=bool, Default="false", Value = "false" DeviceLanguage = Type=string, Allowed="UNKNOWN" "ENGLISH" "FRENCH" "GERMAN" "SPANISH" "ITALIAN" "PORTUGUESE" "DUTCH" "TURKISH" "CROATIAN" "CZECH" "DANISH" "FINNISH" "HUNGARIAN" "NORWEGIAN" "POLISH" "RUSSIAN" "SERBIAN" "SLOVAK" "SLOVENIAN" "SWEDISH" "UKRAINIAN" "GREEK" "JAPANESE" "SIMPL_CHINESE" "TRAD_CHINESE" "KOREAN" "ICELANDIC" "FLEMISH" "THAI" "AFRIKAANS" "ALBANIAN" "AMHARIC" "ARABIC" "ARMENIAN" "AZERBAIJANI" "TAGALOG" "BELARUSSIAN" "BENGALI" "BULGARIAN" "BURMESE" "CATALAN" "ESTONIAN" "FARSI" "GAELIC" "GEORGIAN" "GUJARATI" "HEBREW" "HINDI" "INDONESIAN" "IRISH" "KANNADA" "KAZAKH" "KHMER" "LAO" "LATVIAN" "LITHUANIAN" "MACEDONIAN" "MALAY" "MALAYALAM" "MARATHI" "MOLDOVIAN" "MONGOLIAN" "PUNJABI" "ROMANIAN" "SINHALESE" "SOMALI" "SWAHILI" "TAJIK" "TAMIL" "TELUGU" "TIBETAN" "TIGRINYA" "TURKMEN" "URDU" "UZBEK" "VIETNAMESE" "WELSH" "ZULU" "", Default="", Value = "" DeviceMainsPower = Type=bool, Default="false", Value = "false" DeviceName = Type=string, Default="My Computer", Value = "My Computer" -DeviceOS = Type=string, Allowed="NONE" "SYMBIAN" "BREW" "WINDOWS" "WINMOBILE" "LINUX" "WIPI" "NDS" "ARM_SEMIH" "NUCLEUS" "NGI" "WINCE" "SHARPEMP" "OSX" "IPHONE" "UIQ" "PS3" "X360" "BADA" "ANDROID" "WEBOS" "QNX", Default="NONE", Value = "NONE" +DeviceOS = Type=string, Allowed="NONE" "SYMBIAN" "BREW" "WINDOWS" "WINMOBILE" "LINUX" "WIPI" "NDS" "ARM_SEMIH" "NUCLEUS" "NGI" "WINCE" "SHARPEMP" "OSX" "IPHONE" "UIQ" "PS3" "X360" "BADA" "ANDROID" "WEBOS" "QNX", Default="NONE", Value = "ANDROID" DeviceOSVersion = Type=string, Default="", Value = "" DeviceOSVersionNumber = Type=int, Default="0", Value = "0" DevicePhoneNumber = Type=string, Default="0044123456789", Value = "0044123456789" @@ -56,11 +56,11 @@ LocationLatitude = Type=float, Min=-90.000000, Max=90.000000, Defa LocationLongitude = Type=float, Min=-180.000000, Max=180.000000, Default="-0.191084", Value = "-0.191084" LocationSpeed = Type=float, Min=0.000000, Max=10000.000000, Default="0", Value = "0" LocationVerticalAccuracy = Type=float, Min=0.000000, Max=100000.000000, Default="100.0", Value = "100.0" -MacOSSimulatorCustomSettings = Type=string, Default="", Value = "" +MacOSSimulatorCustomSettings = Type=string, Default="", Value = "NONE:OSX:480x320" MacOSSimulatorDevices_ANDROID = Type=string, Allowed="Samsung Galaxy S:480x800:512" "HTC Sensation XL:480x800:768" "Samsung Galaxy Note:800x1280:1024" "Motorola Droid Razr:540x960:1024" "Kindle Fire:1024x600:512" "Samsung Galaxy Tab:1024x600:512", Default="Samsung Galaxy S:480x800:512", Value = "Samsung Galaxy S:480x800:512" -MacOSSimulatorDevices_IPHONE = Type=string, Allowed="iPhone 3GS:320x480:256" "iPhone 4:640x960:512" "iPad 2:768x1024:512", Default="iPhone 3GS:320x480:256", Value = "iPhone 3GS:320x480:256" -MacOSSimulatorPlatforms = Type=string, Allowed="IPHONE" "ANDROID", Default="IPHONE", Value = "IPHONE" -MacOSSimulatorUseCustomSettings = Type=bool, Default="true", Value = "true" +MacOSSimulatorDevices_IPHONE = Type=string, Allowed="iPhone 3GS:320x480:256" "iPhone 4:640x960:512" "iPhone 5:640x1136:1024" "iPad:768x1024:256" "iPad 2:768x1024:512" "iPad 3:1536x2048:1024", Default="iPhone 3GS:320x480:256", Value = "iPhone 3GS:320x480:256" +MacOSSimulatorPlatforms = Type=string, Allowed="IPHONE" "ANDROID", Default="IPHONE", Value = "ANDROID" +MacOSSimulatorUseCustomSettings = Type=bool, Default="true", Value = "false" MemoryPoison = Type=bool, Default="true", Value = "true" MemoryPoisonAlloc = Type=int, Min=0.000000, Max=255.000000, Default="170", Value = "170" MemoryPoisonFree = Type=int, Min=0.000000, Max=255.000000, Default="221", Value = "221" @@ -87,11 +87,11 @@ SoundStereo = Type=bool, Default="true", Value = "true" SoundVolumeDefault = Type=int, Min=0.000000, Max=256.000000, Default="256", Value = "256" SurfaceDisableWhenGLIsActive = Type=bool, Default="false", Value = "false" SurfaceDoubleBuffer = Type=bool, Default="false", Value = "false" -SurfaceHeight = Type=int, Min=128.000000, Max=4096.000000, Default="480", Value = "320" +SurfaceHeight = Type=int, Min=128.000000, Max=4096.000000, Default="480", Value = "800" SurfacePitch = Type=int, Min=0.000000, Max=8192.000000, Default="0", Value = "0" SurfacePixelType = Type=string, Allowed="RGB444" "RGB555" "RGB565" "RGB666" "RGB888" "BGR444" "BGR555" "BGR565" "BGR666" "BGR888", Default="RGB565", Value = "RGB565" -SurfacePredefinedResolution = Type=string, Allowed="176x200" "176x208" "240x320 (QVGA Portrait)" "240x400" "320x240 (QVGA Landscape)" "320x400" "320x480 (iPhone Portrait)" "400x240" "480x320 (iPhone Landscape)" "360x640 (qHD Portrait)" "640x360 (qHD Landscape)" "480x640 (VGA Portrait)" "480x800 (WVGA Portrait)" "640x480 (VGA Landscape)" "800x400" "800x480 (WVGA Landscape)" "640x960 (iPhone 4 Portrait)" "960x640 (iPhone 4 Landscape)" "1024x600 (Playbook Landscape)" "600x1024 (Playbook Portrait)" "768x1024 (iPad Portrait)" "1024x768 (iPad Landscape)" "2048x1536 (iPad Retina Landscape)" "1536x2048 (iPad Retina Portrait)", Default="320x480 (iPhone Portrait)", Value = "176x200" -SurfaceRotation = Type=string, Allowed="Rot0" "Rot90" "Rot180" "Rot270", Default="Rot0", Value = "Rot0" +SurfacePredefinedResolution = Type=string, Allowed="176x200" "176x208" "240x320 (QVGA Portrait)" "240x400" "320x240 (QVGA Landscape)" "320x400" "320x480 (iPhone Portrait)" "400x240" "480x320 (iPhone Landscape)" "360x640 (qHD Portrait)" "640x360 (qHD Landscape)" "480x640 (VGA Portrait)" "480x800 (WVGA Portrait)" "640x480 (VGA Landscape)" "800x400" "800x480 (WVGA Landscape)" "640x960 (iPhone 4 Portrait)" "960x640 (iPhone 4 Landscape)" "640x1136 (iPhone 5 Portrait)" "1136x640 (iPhone 5 Landscape)" "1024x600 (Playbook Landscape)" "600x1024 (Playbook Portrait)" "768x1024 (iPad Portrait)" "1024x768 (iPad Landscape)" "2048x1536 (iPad Retina Landscape)" "1536x2048 (iPad Retina Portrait)", Default="320x480 (iPhone Portrait)", Value = "176x200" +SurfaceRotation = Type=string, Allowed="Rot0" "Rot90" "Rot180" "Rot270", Default="Rot0", Value = "Rot90" SurfaceUnalign = Type=bool, Default="true", Value = "true" SurfaceUseMultiBuffers = Type=bool, Default="true", Value = "true" SurfaceWidth = Type=int, Min=128.000000, Max=4096.000000, Default="320", Value = "480" diff --git a/samples/Cpp/TestCpp/proj.marmalade/TestCPP.mkb b/samples/Cpp/TestCpp/proj.marmalade/TestCPP.mkb index b0f559c543..d159bf55de 100644 --- a/samples/Cpp/TestCpp/proj.marmalade/TestCPP.mkb +++ b/samples/Cpp/TestCpp/proj.marmalade/TestCPP.mkb @@ -447,10 +447,10 @@ files TextureCacheTest.cpp TextureCacheTest.h - [Test/TexturePackerEncryptionTest] - [../Classes/TexturePackerEncryptionTest] - TexturePackerEncryptionTest.cpp - TexturePackerEncryptionTest.h + [Test/TexturePackerEncryptionTest] + (../Classes/TexturePackerEncryptionTest) + TextureAtlasEncryptionTest.cpp + TextureAtlasEncryptionTest.h [Test/TileMapTest] (../Classes/TileMapTest) diff --git a/samples/Lua/HelloLua/Resources/development.icf b/samples/Lua/HelloLua/Resources/development.icf index c670b09718..09e69865f0 100644 --- a/samples/Lua/HelloLua/Resources/development.icf +++ b/samples/Lua/HelloLua/Resources/development.icf @@ -58,7 +58,7 @@ LocationSpeed = Type=float, Min=0.000000, Max=10000.000000, Def LocationVerticalAccuracy = Type=float, Min=0.000000, Max=100000.000000, Default="100.0", Value = "100.0" MacOSSimulatorCustomSettings = Type=string, Default="", Value = "" MacOSSimulatorDevices_ANDROID = Type=string, Allowed="Samsung Galaxy S:480x800:512" "HTC Sensation XL:480x800:768" "Samsung Galaxy Note:800x1280:1024" "Motorola Droid Razr:540x960:1024" "Kindle Fire:1024x600:512" "Samsung Galaxy Tab:1024x600:512", Default="Samsung Galaxy S:480x800:512", Value = "Samsung Galaxy S:480x800:512" -MacOSSimulatorDevices_IPHONE = Type=string, Allowed="iPhone 3GS:320x480:256" "iPhone 4:640x960:512" "iPad 2:768x1024:512", Default="iPhone 3GS:320x480:256", Value = "iPhone 3GS:320x480:256" +MacOSSimulatorDevices_IPHONE = Type=string, Allowed="iPhone 3GS:320x480:256" "iPhone 4:640x960:512" "iPhone 5:640x1136:1024" "iPad:768x1024:256" "iPad 2:768x1024:512" "iPad 3:1536x2048:1024", Default="iPhone 3GS:320x480:256", Value = "iPhone 3GS:320x480:256" MacOSSimulatorPlatforms = Type=string, Allowed="IPHONE" "ANDROID", Default="IPHONE", Value = "IPHONE" MacOSSimulatorUseCustomSettings = Type=bool, Default="true", Value = "true" MemoryPoison = Type=bool, Default="true", Value = "true" @@ -90,7 +90,7 @@ SurfaceDoubleBuffer = Type=bool, Default="false", Value = "false" SurfaceHeight = Type=int, Min=128.000000, Max=4096.000000, Default="480", Value = "320" SurfacePitch = Type=int, Min=0.000000, Max=8192.000000, Default="0", Value = "0" SurfacePixelType = Type=string, Allowed="RGB444" "RGB555" "RGB565" "RGB666" "RGB888" "BGR444" "BGR555" "BGR565" "BGR666" "BGR888", Default="RGB565", Value = "RGB565" -SurfacePredefinedResolution = Type=string, Allowed="176x200" "176x208" "240x320 (QVGA Portrait)" "240x400" "320x240 (QVGA Landscape)" "320x400" "320x480 (iPhone Portrait)" "400x240" "480x320 (iPhone Landscape)" "360x640 (qHD Portrait)" "640x360 (qHD Landscape)" "480x640 (VGA Portrait)" "480x800 (WVGA Portrait)" "640x480 (VGA Landscape)" "800x400" "800x480 (WVGA Landscape)" "640x960 (iPhone 4 Portrait)" "960x640 (iPhone 4 Landscape)" "1024x600 (Playbook Landscape)" "600x1024 (Playbook Portrait)" "768x1024 (iPad Portrait)" "1024x768 (iPad Landscape)" "2048x1536 (iPad Retina Landscape)" "1536x2048 (iPad Retina Portrait)", Default="320x480 (iPhone Portrait)", Value = "176x200" +SurfacePredefinedResolution = Type=string, Allowed="176x200" "176x208" "240x320 (QVGA Portrait)" "240x400" "320x240 (QVGA Landscape)" "320x400" "320x480 (iPhone Portrait)" "400x240" "480x320 (iPhone Landscape)" "360x640 (qHD Portrait)" "640x360 (qHD Landscape)" "480x640 (VGA Portrait)" "480x800 (WVGA Portrait)" "640x480 (VGA Landscape)" "800x400" "800x480 (WVGA Landscape)" "640x960 (iPhone 4 Portrait)" "960x640 (iPhone 4 Landscape)" "640x1136 (iPhone 5 Portrait)" "1136x640 (iPhone 5 Landscape)" "1024x600 (Playbook Landscape)" "600x1024 (Playbook Portrait)" "768x1024 (iPad Portrait)" "1024x768 (iPad Landscape)" "2048x1536 (iPad Retina Landscape)" "1536x2048 (iPad Retina Portrait)", Default="320x480 (iPhone Portrait)", Value = "176x200" SurfaceRotation = Type=string, Allowed="Rot0" "Rot90" "Rot180" "Rot270", Default="Rot0", Value = "Rot0" SurfaceUnalign = Type=bool, Default="true", Value = "true" SurfaceUseMultiBuffers = Type=bool, Default="true", Value = "true" diff --git a/samples/Lua/HelloLua/proj.marmalade/HelloLua.mkb b/samples/Lua/HelloLua/proj.marmalade/HelloLua.mkb index afaf968528..bebf68dd2d 100644 --- a/samples/Lua/HelloLua/proj.marmalade/HelloLua.mkb +++ b/samples/Lua/HelloLua/proj.marmalade/HelloLua.mkb @@ -1,6 +1,6 @@ options { - module_path="../../../../cocos2dx/proj.marmalade/;../../../../CocosDenshion/proj.marmalade/;../../../../scripting/lua/proj.marmalade/;../../../extensions/proj.marmalade/" + module_path="../../../../cocos2dx/proj.marmalade/;../../../../CocosDenshion/proj.marmalade/;../../../../scripting/lua/proj.marmalade/;../../../extensions/proj.marmalade/;../../../../extensions/proj.marmalade/;../../../../external/chipmunk/proj.marmalade/;../../../../external/Box2D/proj.marmalade/" s3e-data-dir = "../Resources/" } @@ -13,9 +13,16 @@ subprojects IwGL cocos2dx CocosDenshion + cocos2dx-ext + Box2D lua } +defines +{ + CC_ENABLE_BOX2D_INTEGRATION=1 +} + assets { (../Resources) diff --git a/samples/Lua/TestLua/Resources/development.icf b/samples/Lua/TestLua/Resources/development.icf index c670b09718..09e69865f0 100644 --- a/samples/Lua/TestLua/Resources/development.icf +++ b/samples/Lua/TestLua/Resources/development.icf @@ -58,7 +58,7 @@ LocationSpeed = Type=float, Min=0.000000, Max=10000.000000, Def LocationVerticalAccuracy = Type=float, Min=0.000000, Max=100000.000000, Default="100.0", Value = "100.0" MacOSSimulatorCustomSettings = Type=string, Default="", Value = "" MacOSSimulatorDevices_ANDROID = Type=string, Allowed="Samsung Galaxy S:480x800:512" "HTC Sensation XL:480x800:768" "Samsung Galaxy Note:800x1280:1024" "Motorola Droid Razr:540x960:1024" "Kindle Fire:1024x600:512" "Samsung Galaxy Tab:1024x600:512", Default="Samsung Galaxy S:480x800:512", Value = "Samsung Galaxy S:480x800:512" -MacOSSimulatorDevices_IPHONE = Type=string, Allowed="iPhone 3GS:320x480:256" "iPhone 4:640x960:512" "iPad 2:768x1024:512", Default="iPhone 3GS:320x480:256", Value = "iPhone 3GS:320x480:256" +MacOSSimulatorDevices_IPHONE = Type=string, Allowed="iPhone 3GS:320x480:256" "iPhone 4:640x960:512" "iPhone 5:640x1136:1024" "iPad:768x1024:256" "iPad 2:768x1024:512" "iPad 3:1536x2048:1024", Default="iPhone 3GS:320x480:256", Value = "iPhone 3GS:320x480:256" MacOSSimulatorPlatforms = Type=string, Allowed="IPHONE" "ANDROID", Default="IPHONE", Value = "IPHONE" MacOSSimulatorUseCustomSettings = Type=bool, Default="true", Value = "true" MemoryPoison = Type=bool, Default="true", Value = "true" @@ -90,7 +90,7 @@ SurfaceDoubleBuffer = Type=bool, Default="false", Value = "false" SurfaceHeight = Type=int, Min=128.000000, Max=4096.000000, Default="480", Value = "320" SurfacePitch = Type=int, Min=0.000000, Max=8192.000000, Default="0", Value = "0" SurfacePixelType = Type=string, Allowed="RGB444" "RGB555" "RGB565" "RGB666" "RGB888" "BGR444" "BGR555" "BGR565" "BGR666" "BGR888", Default="RGB565", Value = "RGB565" -SurfacePredefinedResolution = Type=string, Allowed="176x200" "176x208" "240x320 (QVGA Portrait)" "240x400" "320x240 (QVGA Landscape)" "320x400" "320x480 (iPhone Portrait)" "400x240" "480x320 (iPhone Landscape)" "360x640 (qHD Portrait)" "640x360 (qHD Landscape)" "480x640 (VGA Portrait)" "480x800 (WVGA Portrait)" "640x480 (VGA Landscape)" "800x400" "800x480 (WVGA Landscape)" "640x960 (iPhone 4 Portrait)" "960x640 (iPhone 4 Landscape)" "1024x600 (Playbook Landscape)" "600x1024 (Playbook Portrait)" "768x1024 (iPad Portrait)" "1024x768 (iPad Landscape)" "2048x1536 (iPad Retina Landscape)" "1536x2048 (iPad Retina Portrait)", Default="320x480 (iPhone Portrait)", Value = "176x200" +SurfacePredefinedResolution = Type=string, Allowed="176x200" "176x208" "240x320 (QVGA Portrait)" "240x400" "320x240 (QVGA Landscape)" "320x400" "320x480 (iPhone Portrait)" "400x240" "480x320 (iPhone Landscape)" "360x640 (qHD Portrait)" "640x360 (qHD Landscape)" "480x640 (VGA Portrait)" "480x800 (WVGA Portrait)" "640x480 (VGA Landscape)" "800x400" "800x480 (WVGA Landscape)" "640x960 (iPhone 4 Portrait)" "960x640 (iPhone 4 Landscape)" "640x1136 (iPhone 5 Portrait)" "1136x640 (iPhone 5 Landscape)" "1024x600 (Playbook Landscape)" "600x1024 (Playbook Portrait)" "768x1024 (iPad Portrait)" "1024x768 (iPad Landscape)" "2048x1536 (iPad Retina Landscape)" "1536x2048 (iPad Retina Portrait)", Default="320x480 (iPhone Portrait)", Value = "176x200" SurfaceRotation = Type=string, Allowed="Rot0" "Rot90" "Rot180" "Rot270", Default="Rot0", Value = "Rot0" SurfaceUnalign = Type=bool, Default="true", Value = "true" SurfaceUseMultiBuffers = Type=bool, Default="true", Value = "true" diff --git a/samples/Lua/TestLua/proj.marmalade/TestLua.mkb b/samples/Lua/TestLua/proj.marmalade/TestLua.mkb index 1f5dc080aa..8d44c5527a 100644 --- a/samples/Lua/TestLua/proj.marmalade/TestLua.mkb +++ b/samples/Lua/TestLua/proj.marmalade/TestLua.mkb @@ -42,7 +42,7 @@ files AppDelegate.cpp } -postbuild "${MARMALADE_ROOT}/s3e/python/python ./cccopy.py -s ../../../../samples/Cpp/TestCpp/Resources/ -d ../../../../samples/Lua/TestLua/Resources/" +postbuild "cccopy.py -s ../../../../samples/Cpp/TestCpp/Resources/ -d ../../../../samples/Lua/TestLua/Resources/" -postbuild "${MARMALADE_ROOT}/s3e/python/python ./cccopy.py -s ../../../../scripting/lua/script/ -d ../../../../samples/Lua/TestLua/Resources/" +postbuild "cccopy.py -s ../../../../scripting/lua/script/ -d ../../../../samples/Lua/TestLua/Resources/" From 3b9f669b513c0a0fc6d144fe619069092f4e2130 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 6 Jun 2013 14:41:22 +0800 Subject: [PATCH 9/9] Minor fix for CCSprite::draw(), checking whether texture is valid, if it's invalid, don't set the attribute for it. --- cocos2dx/sprite_nodes/CCSprite.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/cocos2dx/sprite_nodes/CCSprite.cpp b/cocos2dx/sprite_nodes/CCSprite.cpp index 900a2bf97c..336130abe5 100644 --- a/cocos2dx/sprite_nodes/CCSprite.cpp +++ b/cocos2dx/sprite_nodes/CCSprite.cpp @@ -554,17 +554,13 @@ void CCSprite::draw(void) if (m_pobTexture != NULL) { ccGLBindTexture2D( m_pobTexture->getName() ); + ccGLEnableVertexAttribs( kCCVertexAttribFlag_PosColorTex ); } else { ccGLBindTexture2D(0); + ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position | kCCVertexAttribFlag_Color ); } - - // - // Attributes - // - - ccGLEnableVertexAttribs( kCCVertexAttribFlag_PosColorTex ); #define kQuadSize sizeof(m_sQuad.bl) #ifdef EMSCRIPTEN @@ -578,10 +574,13 @@ void CCSprite::draw(void) int diff = offsetof( ccV3F_C4B_T2F, vertices); glVertexAttribPointer(kCCVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, kQuadSize, (void*) (offset + diff)); - // texCoods - diff = offsetof( ccV3F_C4B_T2F, texCoords); - glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (void*)(offset + diff)); - + if (m_pobTexture != NULL) + { + // texCoods + diff = offsetof( ccV3F_C4B_T2F, texCoords); + glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (void*)(offset + diff)); + } + // color diff = offsetof( ccV3F_C4B_T2F, colors); glVertexAttribPointer(kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (void*)(offset + diff));