problem with loading pvr


#1

help guys.
and my code is:

CCTexture2D::PVRImagesHavePremultipliedAlpha(true);
    CCSpriteFrameCache *cache = CCSpriteFrameCache::sharedSpriteFrameCache();
    cache->addSpriteFramesWithFile(CCString::stringWithFormat("%s", "aaa.plist")->getCString(), CCString::stringWithFormat("%s", "aaa.pvr.ccz")->getCString());
    CCArray *spriteFrames = CCArray::arrayWithCapacity(8);
    for(int i = 1; i<9; i++){
        CCString *frameName = CCString::stringWithFormat("%d%s", i, ".png");
        CCSpriteFrame *frame = cache->spriteFrameByName(frameName->getCString());
        spriteFrames->addObject(frame);
    }
    CCAnimation *animation = CCAnimation::animationWithSpriteFrames(spriteFrames, 0.4);
    CCRepeatForever::actionWithAction(CCAnimate::actionWithAnimation(animation));
    cache->removeSpriteFramesFromFile(CCString::stringWithFormat("%s", "aaa.plist")->getCString());

and always error:

2012-06-10 04:30:58.920 YiZu[4107:ce03] cocos2d: surface size: 480x320
Cocos2d: cocos2d: cocos2d-2.0-rc0a-x-2.0
Cocos2d: cocos2d: padding: 0,0,0,0
Cocos2d: cocos2d: GL_VENDOR:     Apple Computer, Inc.
Cocos2d: cocos2d: GL_RENDERER:   Apple Software Renderer
Cocos2d: cocos2d: GL_VERSION:    OpenGL ES 2.0 APPLE
Cocos2d: cocos2d: GL_MAX_TEXTURE_SIZE: 2048
Cocos2d: cocos2d: GL_MAX_TEXTURE_UNITS: 8
Cocos2d: cocos2d: GL supports PVRTC: YES
Cocos2d: cocos2d: GL supports BGRA8888 textures: NO
Cocos2d: cocos2d: GL supports NPOT textures: YES
Cocos2d: cocos2d: GL supports discard_framebuffer: YES
Cocos2d: cocos2d: compiled with Profiling Support: NO
Cocos2d: cocos2d: WARNING: PVR NPOT textures are not supported. Regenerate it.
Cocos2d: cocos2d: Couldn't load PVR image /Users/Abel/Library/Application Support/iPhone Simulator/4.3.2/Applications/49CE01D0-6326-490A-B46B-1DB950CF8733/YiZu.app/aaa.pvr.ccz
Cocos2d: cocos2d: Couldn't add PVRImage:/Users/Abel/Library/Application Support/iPhone Simulator/4.3.2/Applications/49CE01D0-6326-490A-B46B-1DB950CF8733/YiZu.app/aaa.pvr.ccz in CCTextureCache
Cocos2d: cocos2d: CCSpriteFrameCache: couldn't load texture file. File not found aaa.pvr.ccz

I’m a new guy.
plz help!
thanks advanced!


#2

you could check your file path of aaa.pvr.ccz.


#3

it’s in Resource, and not just reference.
I run it in Simulator on my iMac, is it the problem?