bool CCImage::initWithImageFile(const char * strPath, EImageFormat eImgFmt/* = eFmtPng*/) { CC_UNUSED_PARAM(eImgFmt); CCFileData data(CCFileUtils::fullPathFromRelativePath(strPath), "rb"); return initWithImageData(data.getBuffer(), data.getSize(), eImgFmt); }
void CCActionInstant::step(float dt) { CC_UNUSED_PARAM(dt); update(1); }
void CCShow::update(float time) { CC_UNUSED_PARAM(time); m_pTarget->setVisible(true); }
void CCRemoveSelf::update(float time) { CC_UNUSED_PARAM(time); m_pTarget->removeFromParentAndCleanup(m_bIsNeedCleanUp); }
void CCPlace::update(float time) { CC_UNUSED_PARAM(time); m_pTarget->setPosition(m_tPosition); }
void endElement(void *ctx, const char *name) { CC_UNUSED_PARAM(ctx); SAXState curState = _stateStack.empty() ? SAX_DICT : _stateStack.top(); const std::string sName((char*)name); if( sName == "dict" ) { _stateStack.pop(); _dictStack.pop(); if ( !_dictStack.empty()) { _curDict = _dictStack.top(); } } else if (sName == "array") { _stateStack.pop(); _arrayStack.pop(); if (! _arrayStack.empty()) { _curArray = _arrayStack.top(); } } else if (sName == "true") { if (SAX_ARRAY == curState) { _curArray->push_back(Value(true)); } else if (SAX_DICT == curState) { (*_curDict)[_curKey] = Value(true); } } else if (sName == "false") { if (SAX_ARRAY == curState) { _curArray->push_back(Value(false)); } else if (SAX_DICT == curState) { (*_curDict)[_curKey] = Value(false); } } else if (sName == "string" || sName == "integer" || sName == "real") { if (SAX_ARRAY == curState) { if (sName == "string") _curArray->push_back(Value(_curValue)); else if (sName == "integer") _curArray->push_back(Value(atoi(_curValue.c_str()))); else _curArray->push_back(Value(utils::atof(_curValue.c_str()))); } else if (SAX_DICT == curState) { if (sName == "string") (*_curDict)[_curKey] = Value(_curValue); else if (sName == "integer") (*_curDict)[_curKey] = Value(atoi(_curValue.c_str())); else (*_curDict)[_curKey] = Value(utils::atof(_curValue.c_str())); } _curValue.clear(); } _state = SAX_NONE; }
void CCHide::update(float time) { CC_UNUSED_PARAM(time); m_pTarget->setVisible(false); }
void InputDelegate::onTouchesEnded(const std::vector<Touch*>& pTouches, Event *pEvent) { CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent); }
void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent) { CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent); ScriptingCore::getInstance()->executeCustomTouchEvent(CCTOUCHENDED, pTouch, _mObj); }
bool InputDelegate::onTouchBegan(Touch *pTouch, Event *pEvent) { CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent); return true; }
void InputDelegate::onTouchCancelled(Touch *pTouch, Event *pEvent) { CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent); }
void CCActionInstant::update(ccTime time) { CC_UNUSED_PARAM(time); // ignore }
void CCActionInstant::step(ccTime dt) { CC_UNUSED_PARAM(dt); update(1); }
bool CCImage::initWithImageFileThreadSafe(const char *fullpath, EImageFormat imageType) { CC_UNUSED_PARAM(imageType); CCFileData data(fullpath, "rb"); return initWithImageData(data.getBuffer(), data.getSize(), imageType); }
void CCAction::update(float time) { CC_UNUSED_PARAM(time); CCLOG("[Action update]. override me"); }
// optional void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent) { CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent); ScriptingCore::getInstance()->executeCustomTouchesEvent(CCTOUCHBEGAN, pTouches, _mObj); }
void startElement(void *ctx, const char *name, const char **atts) { CC_UNUSED_PARAM(ctx); CC_UNUSED_PARAM(atts); const std::string sName(name); if( sName == "dict" ) { if(_resultType == SAX_RESULT_DICT && _rootDict.empty()) { _curDict = &_rootDict; } _state = SAX_DICT; SAXState preState = SAX_NONE; if (! _stateStack.empty()) { preState = _stateStack.top(); } if (SAX_ARRAY == preState) { // add a new dictionary into the array _curArray->push_back(Value(ValueMap())); _curDict = &(_curArray->rbegin())->asValueMap(); } else if (SAX_DICT == preState) { // add a new dictionary into the pre dictionary CCASSERT(! _dictStack.empty(), "The state is wrong!"); ValueMap* preDict = _dictStack.top(); (*preDict)[_curKey] = Value(ValueMap()); _curDict = &(*preDict)[_curKey].asValueMap(); } // record the dict state _stateStack.push(_state); _dictStack.push(_curDict); } else if(sName == "key") { _state = SAX_KEY; } else if(sName == "integer") { _state = SAX_INT; } else if(sName == "real") { _state = SAX_REAL; } else if(sName == "string") { _state = SAX_STRING; } else if (sName == "array") { _state = SAX_ARRAY; if (_resultType == SAX_RESULT_ARRAY && _rootArray.empty()) { _curArray = &_rootArray; } SAXState preState = SAX_NONE; if (! _stateStack.empty()) { preState = _stateStack.top(); } if (preState == SAX_DICT) { (*_curDict)[_curKey] = Value(ValueVector()); _curArray = &(*_curDict)[_curKey].asValueVector(); } else if (preState == SAX_ARRAY) { CCASSERT(! _arrayStack.empty(), "The state is wrong!"); ValueVector* preArray = _arrayStack.top(); preArray->push_back(Value(ValueVector())); _curArray = &(_curArray->rbegin())->asValueVector(); } // record the array state _stateStack.push(_state); _arrayStack.push(_curArray); } else { _state = SAX_NONE; } }
void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) { CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent); ScriptingCore::getInstance()->executeCustomTouchesEvent(CCTOUCHCANCELLED, pTouches, _mObj); }
void CCMotionStreak::setOpacityModifyRGB(bool bValue) { CC_UNUSED_PARAM(bValue); }
void CCTouchDispatcher::setPriority(int nPriority, CCTouchDelegate *pDelegate) { CC_UNUSED_PARAM(nPriority); CC_UNUSED_PARAM(pDelegate); assert(0); }
void CCToggleVisibility::update(float time) { CC_UNUSED_PARAM(time); m_pTarget->setVisible(!m_pTarget->isVisible()); }
bool EventListenerPhysicsContact::hitTest(PhysicsShape* shapeA, PhysicsShape* shapeB) { CC_UNUSED_PARAM(shapeA); CC_UNUSED_PARAM(shapeB); return true; }
void CCFlipY::update(float time) { CC_UNUSED_PARAM(time); ((CCSprite*) (m_pTarget))->setFlipY(m_bFlipY); }
void Spider::actionDownEnd(cocos2d::CCObject *s) { Spider* spider = (Spider*)s; CC_UNUSED_PARAM(spider); }
void CCCallFunc::update(float time) { CC_UNUSED_PARAM(time); this->execute(); }
void CCParticleSystem::updateQuadWithParticle(tCCParticle* particle, const CCPoint& newPosition) { CC_UNUSED_PARAM(particle); CC_UNUSED_PARAM(newPosition); // should be overriden }
void CCActionInstant::update(float time) { CC_UNUSED_PARAM(time); // nothing }
CCData * CCRenderTexture::getUIImageAsDataFromBuffer(int format) { CC_UNUSED_PARAM(format); CCData * pData = NULL; //@ todo CCRenderTexture::getUIImageAsDataFromBuffer // #include "Availability.h" // #include "UIKit.h" // GLubyte * pBuffer = NULL; // GLubyte * pPixels = NULL; // do // { // CC_BREAK_IF(! m_pTexture); // // CCAssert(m_ePixelFormat == kCCTexture2DPixelFormat_RGBA8888, "only RGBA8888 can be saved as image"); // // const CCSize& s = m_pTexture->getContentSizeInPixels(); // int tx = s.width; // int ty = s.height; // // int bitsPerComponent = 8; // int bitsPerPixel = 32; // // int bytesPerRow = (bitsPerPixel / 8) * tx; // int myDataLength = bytesPerRow * ty; // // CC_BREAK_IF(! (pBuffer = new GLubyte[tx * ty * 4])); // CC_BREAK_IF(! (pPixels = new GLubyte[tx * ty * 4])); // // this->begin(); // glReadPixels(0,0,tx,ty,GL_RGBA,GL_UNSIGNED_BYTE, pBuffer); // this->end(); // // int x,y; // // for(y = 0; y <ty; y++) { // for(x = 0; x <tx * 4; x++) { // pPixels[((ty - 1 - y) * tx * 4 + x)] = pBuffer[(y * 4 * tx + x)]; // } // } // // if (format == kCCImageFormatRawData) // { // pData = CCData::dataWithBytesNoCopy(pPixels, myDataLength); // break; // } //@ todo impliment save to jpg or png /* CGImageCreate(size_t width, size_t height, size_t bitsPerComponent, size_t bitsPerPixel, size_t bytesPerRow, CGColorSpaceRef space, CGBitmapInfo bitmapInfo, CGDataProviderRef provider, const CGFloat decode[], bool shouldInterpolate, CGColorRenderingIntent intent) */ // make data provider with data. // CGBitmapInfo bitmapInfo = kCGImageAlphaPremultipliedLast | kCGBitmapByteOrderDefault; // CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, pixels, myDataLength, NULL); // CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB(); // CGImageRef iref = CGImageCreate(tx, ty, // bitsPerComponent, bitsPerPixel, bytesPerRow, // colorSpaceRef, bitmapInfo, provider, // NULL, false, // kCGRenderingIntentDefault); // // UIImage* image = [[UIImage alloc] initWithCGImage:iref]; // // CGImageRelease(iref); // CGColorSpaceRelease(colorSpaceRef); // CGDataProviderRelease(provider); // // // // if (format == kCCImageFormatPNG) // data = UIImagePNGRepresentation(image); // else // data = UIImageJPEGRepresentation(image, 1.0f); // // [image release]; // } while (0); // // CC_SAFE_DELETE_ARRAY(pBuffer); // CC_SAFE_DELETE_ARRAY(pPixels); return pData; }
void CCAction::step(float dt) { CC_UNUSED_PARAM(dt); CCLOG("[Action step]. override me"); }
void Layer::onTouchesCancelled(const std::vector<Touch*>& touches, Event *unused_event) { CC_UNUSED_PARAM(unused_event); }