Merge pull request #2785 from dumganhar/develop

Sync some fixes from master branch
This commit is contained in:
James Chen 2013-06-06 00:09:21 -07:00
commit 3a3db53894
9 changed files with 32 additions and 17 deletions

View File

@ -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
}

View File

@ -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

View File

@ -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<CCTexture2D*>(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);

View File

@ -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"

View File

@ -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__

View File

@ -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) {

View File

@ -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;

View File

@ -1 +1 @@
2a27890e1483789f1497834fc5492f39f55d826b
87923a8737ed83b909261c3468098a1c46753969

View File

@ -1 +1 @@
f9f78f7848a9ee31f7c4c919fca1555101c48767
0422f35db193be5e4c66e50b80ced4175aea416c