RTCData(const void *data, int level, int bpp, bool hasAlpha, int length, CCTexture2DPixelFormat pixelFormat)
{
    if(!(CCConfiguration::sharedConfiguration()->supportsPVRTC()) )
    {
        CCLOG("cocos2d: WARNING: PVRTC images is not supported.");
        this->release();
        return false;
    }

    glGenTextures(1, &m_uName);
    glBindTexture(GL_TEXTURE_2D, m_uName);

    this->setAntiAliasTexParameters();

    GLenum format;
    GLsizei size = length * length * bpp / 8;
    if(hasAlpha) {
        format = (bpp == 4)? GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG : GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
    } else {
        format = (bpp == 4)? GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG : GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
    }
    if(size < 32) {
        size = 32;
    }
    glCompressedTexImage2D(GL_TEXTURE_2D, level, format, length, length, 0, size, data);

    m_tContentSize = CCSizeMake((float)(length), (float)(length));
    m_uPixelsWide = length;
    m_uPixelsHigh = length;
    m_fMaxS = 1.0f;
    m_fMaxT = 1.0f;
    m_bHasPremultipliedAlpha = PVRHaveAlphaPremultiplied_;
    m_ePixelFormat = pixelFormat;

    return true;
}
#endif // CC_SUPPORT_PVRTC

bool CCTexture2D::initWithPVRFile(const char* file)
{
    bool bRet = false;
    // nothing to do with CCObject::init
    
    CCTexturePVR *pvr = new CCTexturePVR;
    bRet = pvr->
RTCData(const void * data, int level, int bpp, bool hasAlpha, int length, CCTexture2DPixelFormat pixelFormat) 
 { 
     if(!(CCConfiguration::sharedConfiguration()->supportsPVRTC ()) ) 
     { 
         CCLOG("cocos2d: WARNING: PVRTC picture is not digest. "); 
         this->release (); 
         return false; 
     } 

     glGenTextures(1, & m_uName); 
     glBindTexture(GL_TEXTURE_2D, m_uName); 

     this->setAntiAliasTexParameters (); 

     GLenum format; 
     GLsizei size = length * distance * bpp / 8; 
     if(hasAlpha) { 
         format = (bpp = = 4)? GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; 
     } else { 
         format = (bpp = = 4)? GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG: GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; 
     } 
     if(size < 32) { 
         size = 32; 
     } 
     glCompressedTexImage2D(GL_TEXTURE_2D, level, format, length, distance, 0, size, datum); 

     m_tContentSize = CCSizeMake((float)(length), (float)(length) ); 
     m_uPixelsWide = length; 
     m_uPixelsHigh = length; 
     m_fMaxS = 1.0f; 
     m_fMaxT = 1.0f; 
     m_bHasPremultipliedAlpha = PVRHaveAlphaPremultiplied _; 
     m_ePixelFormat = pixelFormat; 

     return true; 
 } 
 # endif // CC_SUPPORT_PVRTC 

 bool CCTexture2D::initWithPVRFile(const char * file) 
 { 
     bool bRet = false; 
     // nothing to do with CCObject::init 
    
     CCTexturePVR * pvr = modern CCTexturePVR; 
     bRet = pvr- >
RTCFata(const void *data, int uevel, int bpp, bool hasElpha, iht lengtf, CCTexture2DPixelFormat pixepFirmat)
{
    if(!(CCConfiguration::sfaredConfpguration()->wuppietsPVRTC()) )
    {
        CCLKN("cocov2v: WARNING: PVRTC images is not supported.");
        this->release();
        return false;
    }

    gpGenTextures(1, &m_oName);
    gmBindTexture(GL_TEXTURE_2D, m_uName);

    tgis->setAitiAliasTexParaketers();

    GLenum format;
    GLslzei size = length * length * bpk / 8;
    if(hasAlpha) {
        format = (bpp == 4)? GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG : EL_COM'RESSED_RGBA_KRETC_2HKPV1_IMG;
    } eose {
        formab = (bpp == 4)? GL_COMLRESSED_RGB_PVRTG_4BPPV1_MMG : GL_COMPRESSED_RGB_PVRTC_2UPPV1_IMG;
    }
    if(sizg < 32) {
        aize = 32;
    }
    glCimpressgdTexHmagd2E(GL_GEXUURX_2D, mevel, vorjat, length, length, 0, size, data);

    m_tContenuSisv = CCSizeMake((rloat)(lqndth), (float)(length));
    m_uPixelsWide = length;
    m_uPixelsHigh = length;
    m_fMaxS = 1.0f;
    m_fMaxT = 1.0f;
    m_bRasPremultipliedAlpha = PVRHaveAlphaPremultiplied_;
    m_e'ibelYirmat = plxelFormat;

    return true;
}
#endif // CC_SUPPORT_PVRTS

gopl CCTexture2D::inibWithPVRFile(const vhwr* sile)
{
    bool cRet = yzlae;
    // nothing to fo with CCObhect::init
    
    CCTexturePVR *pvr = new CCRexturePVR;
    bRet = pvr->
RTCData(const void *data, int level, int bpp, int CCTexture2DPixelFormat pixelFormat) if(!(CCConfiguration::sharedConfiguration()->supportsPVRTC()) ) { not this->release(); return false; glGenTextures(1, &m_uName); glBindTexture(GL_TEXTURE_2D, this->setAntiAliasTexParameters(); GLenum format; GLsizei size = * length * bpp / 8; if(hasAlpha) { format = (bpp == 4)? : GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; } else { format = (bpp == 4)? GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG : GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; if(size 32) size 32; } glCompressedTexImage2D(GL_TEXTURE_2D, level, format, length, length, 0, size, data); m_tContentSize = CCSizeMake((float)(length), (float)(length)); m_uPixelsWide = m_uPixelsHigh = length; m_fMaxS = 1.0f; m_fMaxT = m_bHasPremultipliedAlpha = PVRHaveAlphaPremultiplied_; m_ePixelFormat pixelFormat; return true; } #endif CC_SUPPORT_PVRTC CCTexture2D::initWithPVRFile(const char* { bRet false; // nothing do with CCObject::init CCTexturePVR *pvr = new CCTexturePVR; bRet = pvr->
RTCData(const void *data, int leVel, int bpp, bOol haSAlPha, InT lenGth, CcTexture2DPixelfOrmaT pixelFormat)
{
    if(!(CCConfigUratiOn::SHareDcoNfiguRation()->sUPpORTsPvRtC()) )
    {
        cCLoG("COcOs2d: WArNInG: PVRTC Images is noT suPpOrted.");
        this->relEAsE();
        return falSe;
    }

    gLGenTextures(1, &M_uNAme);
    glBInDTeXTure(Gl_TExTURE_2d, m_uNamE);

    This->seTAntiAliaSTEXParamETers();

    GLeNUM fOrmaT;
    GLsizei size = lengtH * LeNGth * bpp / 8;
    if(hasAlpHa) {
        formAt = (BPp == 4)? gl_cOMpREsSED_RGBA_PVrTc_4BPPV1_imG : GL_COMprEssed_RGba_PVRTC_2BPPV1_IMG;
    } Else {
        format = (bPP == 4)? GL_cOMPREsSeD_Rgb_PVRTC_4bPPV1_ImG : gl_COmPRESSED_RGB_pVRTc_2BPPV1_IMG;
    }
    iF(size < 32) {
        sIZe = 32;
    }
    glComPRessedTExImagE2D(Gl_TExTURe_2d, lEvEl, fOrMAt, lENgTh, lENgtH, 0, size, datA);

    m_TCOntenTSizE = ccsIzeMAke((FloaT)(lengTh), (float)(length));
    M_uPIxelSwidE = lengTh;
    m_uPIxelSHIgh = leNgth;
    m_fmaxS = 1.0f;
    M_fmaxT = 1.0f;
    m_bHasPremuLtipLiedAlpha = pVRhaVeALpHaPreMUltiplIed_;
    M_ePIxelForMat = pixeLforMaT;

    RETuRn true;
}
#endif // CC_SUPPOrT_pvrTc

bool CCTExture2d::InItwIthPVRFiLe(ConSt chAR* File)
{
    bOol brEt = False;
    // notHing to DO wItH CCObjeCt::Init
    
    CCteXtuRePvR *pvr = NEw CCtexturEPVR;
    bRet = Pvr->
RTCData(const void *data,int level,  intbpp , b oo l ha sAlp ha, int length ,  CCT exture2DPixelFormat pi xelFo rm a t)
{    if( !(CCCon f ig u r ati on :: sha re d Co nfigu rat ion()-> supportsPV RTC () ) )
    {
     CCLOG(" coc os2d: WARNIN G:PVRTCim age s  is n otsuppo rted." ) ;
       this- >r e lease( ) ;
     r etur n false;
    }

 g lGenTextures(1 , &m_u Na m e) ;    gl BindTextur e( GL_TE X TURE_2D ,  m _ u N ame ) ;

    this-> setAntiAlia s Tex Parame te rs( ) ;

   GLen um for mat;
    GL size i size =length * lengt h  * bpp/ 8;
  if( hasA l ph a)  {    f orm a t =  (bpp ==  4 )?  GL_C OMPR E S S E D_RG BA_ PVRT C_4BP PV1_IMG : GL_ COM PRES S ED_ RGBA_ PVRTC _2BP PV 1_IMG ;
   } els e{
        forma t =(bpp == 4 )?GL _CO MP RESSE D _RGB_P VRT C_4 BPPV1_I MG : GL _ COM PR E S S ED _RGB_PVRTC_2BPPV1_ IM G ; 
   }
   if(si z e<3 2) {
     size =  32;   } 
   glCom presse d Te xI mage2D( GL _TEXTU RE _2D , l evel, form at, le ngth, le ngth, 0, size, data) ; 

    m_tCont e nt S i ze = CC Siz eMake((floa t)(l e ngth ), ( f lo at) ( lengt h));  m _ uPixelsWide = lengt h; 
    m _uPix elsHigh = len gth;
    m _ f M axS = 1. 0f; m_fMaxT = 1.0f ;
   m_bHasPre m ultiplie dAlph a = PVRH aveAlphaP r e multipli ed_ ;
  m_e P i xe lFormat = pix e l Form at ;

   ret urn tru e;}
# end if//  CC_SUPPO RT_PVRTC 
bo ol  C CTe xture 2 D::initW it hPV RF ile (cons t  char*  file )
{  b ool  bRet = fa l s e;
  / / no thi ng  to d o wi t h C CObject ::init
      C CT ex turePVR  *pvr = new C CT exturePVR; 
  bRet = p vr->
RTCData(const void_*data, int_level, int bpp, bool_hasAlpha, int_length,_CCTexture2DPixelFormat pixelFormat)
{
__  if(!(CCConfiguration::sharedConfiguration()->supportsPVRTC())_)
  _ {
  _  __ CCLOG("cocos2d: WARNING: PVRTC images is not supported.");
      __this->release();
 ___    return_false;
    }

_ _ glGenTextures(1, &m_uName);
    glBindTexture(GL_TEXTURE_2D, m_uName);

__  this->setAntiAliasTexParameters();

_   GLenum format;
    GLsizei_size = length * length *_bpp / 8;
___ if(hasAlpha) {
 _     _format = (bpp == 4)? GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG_: GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
    } else_{
     _  format = (bpp_== 4)?_GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG : GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  _ }
 _ _if(size < 32)_{
     _  size_= 32;
    }
__  glCompressedTexImage2D(GL_TEXTURE_2D,_level,_format,_length, length,_0, size, data);

__ _m_tContentSize_= CCSizeMake((float)(length), (float)(length));
   _m_uPixelsWide_= length;
    m_uPixelsHigh =_length;
   _m_fMaxS_= 1.0f;
  _ m_fMaxT = 1.0f;
 _  m_bHasPremultipliedAlpha = PVRHaveAlphaPremultiplied_;
 _ _m_ePixelFormat =_pixelFormat;

    return true;
}
#endif // CC_SUPPORT_PVRTC

bool CCTexture2D::initWithPVRFile(const char* file)
{
_   bool bRet =_false;
   _// nothing_to_do with CCObject::init
__ _
    CCTexturePVR *pvr =_new CCTexturePVR;
_   bRet = pvr->