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 } 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 diff --git a/cocos2dx/sprite_nodes/CCSprite.cpp b/cocos2dx/sprite_nodes/CCSprite.cpp index b0dea7ca5a..336130abe5 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); @@ -556,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 @@ -580,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)); @@ -1085,6 +1082,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); 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__ 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/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) { 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/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.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/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/" 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); 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