Merge branch 'gles20' of https://github.com/dumganhar/cocos2d-x into gles20

This commit is contained in:
James Chen 2012-03-21 10:43:54 +08:00
commit 00a81f5bd0
3 changed files with 18 additions and 6 deletions

View File

@ -126,7 +126,11 @@ public:
Note that RGBA type textures will have their alpha premultiplied - use the blending mode (GL_ONE, GL_ONE_MINUS_SRC_ALPHA).
*/
/** Initializes a texture from a UIImage object */
bool initWithImage(CCImage * uiImage);
#if 0// TODO: (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
bool initWithImage(CCImage * uiImage, ccResolutionType resolution);
#else
bool initWithImage(CCImage * uiImage);
#endif
/**
Extensions to make it easy to create a CCTexture2D object from a string of text.

View File

@ -235,7 +235,7 @@ char * CCTexture2D::description(void)
}
// implementation CCTexture2D (Image)
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#if 0// TODO: #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
bool CCTexture2D::initWithImage(CCImage * uiImage, ccResolutionType resolution)
#else
bool CCTexture2D::initWithImage(CCImage * uiImage)
@ -273,7 +273,7 @@ bool CCTexture2D::initWithImage(CCImage * uiImage)
return NULL;
}
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#if 0//TODO (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
m_resolutionType = resolution;
#endif
@ -486,7 +486,11 @@ bool CCTexture2D::initWithString(const char *text, const CCSize& dimensions, CCT
{
return false;
}
#if 0// TODO: (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
return initWithImage(&image, m_resolutionType);
#else
return initWithImage(&image);
#endif
}

View File

@ -283,7 +283,11 @@ void CCTextureCache::addImageAsyncCallBack(ccTime dt)
// generate texture in render thread
CCTexture2D *texture = new CCTexture2D();
texture->initWithImage(pImage);
#if 0 //TODO: (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
texture->initWithImage(pImage, kCCResolutioniPhone);
#else
texture->initWithImage(pImage);
#endif
#if CC_ENABLE_CACHE_TEXTTURE_DATA
// cache the texture file name
@ -421,7 +425,7 @@ CCTexture2D* CCTextureCache::addPVRTCImage(const char* path, int bpp, bool hasAl
std::string temp(path);
CCFileUtils::ccRemoveHDSuffixFromFile(temp);
if ( (texture = m_pTextures->objectForKey(temp)) )
if ( (texture = (CCTexture2D*)m_pTextures->objectForKey(temp.c_str())) )
{
return texture;
}
@ -435,7 +439,7 @@ CCTexture2D* CCTextureCache::addPVRTCImage(const char* path, int bpp, bool hasAl
if( texture->initWithPVRTCData(data->bytes(), 0, bpp, hasAlpha, width,
(bpp==2 ? kCCTexture2DPixelFormat_PVRTC2 : kCCTexture2DPixelFormat_PVRTC4)))
{
m_pTextures->setObject(texture, temp);
m_pTextures->setObject(texture, temp.c_str());
texture->autorelease();
}
else