adsInfo);
public void queryPoints();
public void spendPoints(int points);
public void setDebugMode(boolean debug);
diff --git a/plugin/samples/HelloAnalytics-JS/proj.android/jni/hellocpp/main.cpp b/plugin/samples/HelloAnalytics-JS/proj.android/jni/hellocpp/main.cpp
index 26a98e22fe..88bf889744 100644
--- a/plugin/samples/HelloAnalytics-JS/proj.android/jni/hellocpp/main.cpp
+++ b/plugin/samples/HelloAnalytics-JS/proj.android/jni/hellocpp/main.cpp
@@ -34,9 +34,9 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
}
else
{
- ccGLInvalidateStateCache();
+ GL::invalidateStateCache();
ShaderCache::getInstance()->reloadDefaultShaders();
- ccDrawInit();
+ DrawPrimitives::init();
TextureCache::reloadAllTextures();
NotificationCenter::getInstance()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
Director::getInstance()->setGLDefaultValues();
diff --git a/plugin/samples/HelloIAP-JS/proj.android/jni/hellocpp/main.cpp b/plugin/samples/HelloIAP-JS/proj.android/jni/hellocpp/main.cpp
index 26a98e22fe..88bf889744 100644
--- a/plugin/samples/HelloIAP-JS/proj.android/jni/hellocpp/main.cpp
+++ b/plugin/samples/HelloIAP-JS/proj.android/jni/hellocpp/main.cpp
@@ -34,9 +34,9 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
}
else
{
- ccGLInvalidateStateCache();
+ GL::invalidateStateCache();
ShaderCache::getInstance()->reloadDefaultShaders();
- ccDrawInit();
+ DrawPrimitives::init();
TextureCache::reloadAllTextures();
NotificationCenter::getInstance()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
Director::getInstance()->setGLDefaultValues();
diff --git a/plugin/samples/HelloPlugins/Classes/AppDelegate.cpp b/plugin/samples/HelloPlugins/Classes/AppDelegate.cpp
index 467d2a3eed..e77c27e7ef 100644
--- a/plugin/samples/HelloPlugins/Classes/AppDelegate.cpp
+++ b/plugin/samples/HelloPlugins/Classes/AppDelegate.cpp
@@ -18,7 +18,7 @@ bool AppDelegate::applicationDidFinishLaunching() {
pDirector->setOpenGLView(pEGLView);
- pEGLView->setDesignResolutionSize(960.0f, 640.0f, kResolutionNoBorder);
+ pEGLView->setDesignResolutionSize(960.0f, 640.0f, ResolutionPolicy::NO_BORDER);
// turn on display FPS
pDirector->setDisplayStats(true);
diff --git a/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.cpp b/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.cpp
index eac0c327f0..2df4bc307a 100644
--- a/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.cpp
+++ b/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.cpp
@@ -32,12 +32,6 @@ const std::string s_aTestCases[] = {
"Admob",
};
-const std::string s_aTestTypes[] = {
- "Banner",
- "Full Screen",
- "More App",
-};
-
const std::string s_aTestPoses[] = {
"Pos: Center",
"Pos: Top",
@@ -89,8 +83,8 @@ bool TestAds::init()
Size visibleSize = Director::getInstance()->getVisibleSize();
Point origin = Director::getInstance()->getVisibleOrigin();
- Point posMid = ccp(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2);
- Point posBR = ccp(origin.x + visibleSize.width, origin.y);
+ Point posMid = Point(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2);
+ Point posBR = Point(origin.x + visibleSize.width, origin.y);
/////////////////////////////
// 2. add a menu item with "X" image, which is clicked to quit the program
@@ -99,7 +93,7 @@ bool TestAds::init()
// add a "close" icon to exit the progress. it's an autorelease object
MenuItemFont *pBackItem = MenuItemFont::create("Back", CC_CALLBACK_1(TestAds::menuBackCallback, this));
Size backSize = pBackItem->getContentSize();
- pBackItem->setPosition(ccpAdd(posBR, ccp(- backSize.width / 2, backSize.height / 2)));
+ pBackItem->setPosition(posBR + Point(- backSize.width / 2, backSize.height / 2));
// create menu, it's an autorelease object
Menu* pMenu = Menu::create(pBackItem, NULL);
@@ -107,15 +101,15 @@ bool TestAds::init()
LabelTTF* label1 = LabelTTF::create("ShowAds", "Arial", 24);
MenuItemLabel* pItemShow = MenuItemLabel::create(label1, CC_CALLBACK_1(TestAds::testShow, this));
- pItemShow->setAnchorPoint(ccp(0.5f, 0));
+ pItemShow->setAnchorPoint(Point(0.5f, 0));
pMenu->addChild(pItemShow, 0);
- pItemShow->setPosition(ccpAdd(posMid, ccp(-100, -120)));
+ pItemShow->setPosition(posMid + Point(-100, -120));
LabelTTF* label2 = LabelTTF::create("HideAds", "Arial", 24);
MenuItemLabel* pItemHide = MenuItemLabel::create(label2, CC_CALLBACK_1(TestAds::testHide, this));
- pItemHide->setAnchorPoint(ccp(0.5f, 0));
+ pItemHide->setAnchorPoint(Point(0.5f, 0));
pMenu->addChild(pItemHide, 0);
- pItemHide->setPosition(ccpAdd(posMid, ccp(100, -120)));
+ pItemHide->setPosition(posMid + Point(100, -120));
// create optional menu
// cases item
@@ -127,21 +121,9 @@ bool TestAds::init()
{
_caseItem->getSubItems()->addObject( MenuItemFont::create( s_aTestCases[i].c_str() ) );
}
- _caseItem->setPosition(ccpAdd(posMid, ccp(-200, 120)));
+ _caseItem->setPosition(posMid + Point(-200, 120));
pMenu->addChild(_caseItem);
- // type item
- _typeItem = MenuItemToggle::createWithCallback(CC_CALLBACK_1(TestAds::typeChanged, this),
- MenuItemFont::create( s_aTestTypes[0].c_str() ),
- NULL );
- int typeLen = sizeof(s_aTestTypes) / sizeof(std::string);
- for (int i = 1; i < typeLen; ++i)
- {
- _typeItem->getSubItems()->addObject( MenuItemFont::create( s_aTestTypes[i].c_str() ) );
- }
- _typeItem->setPosition(ccpAdd(posMid, ccp(0, 120)));
- pMenu->addChild(_typeItem);
-
// poses item
_posItem = MenuItemToggle::createWithCallback(CC_CALLBACK_1(TestAds::posChanged, this),
MenuItemFont::create( s_aTestPoses[0].c_str() ),
@@ -151,13 +133,16 @@ bool TestAds::init()
{
_posItem->getSubItems()->addObject( MenuItemFont::create( s_aTestPoses[i].c_str() ) );
}
- _posItem->setPosition(ccpAdd(posMid, ccp(200, 120)));
+ _posItem->setPosition(posMid + Point(200, 120));
pMenu->addChild(_posItem);
// init options
_ads = _admob;
_pos = ProtocolAds::kPosCenter;
- _type = ProtocolAds::kBannerAd;
+
+ // init the AdsInfo
+ adInfo["AdmobType"] = "1";
+ adInfo["AdmobSizeEnum"] = "1";
this->addChild(pMenu, 1);
@@ -166,30 +151,22 @@ bool TestAds::init()
void TestAds::testShow(Object* pSender)
{
- int nSize = 0;
- if (_ads == _admob)
- {
- nSize = 0;
- }
-
if (_ads)
{
- _ads->showAds(_type, nSize, _pos);
+ _ads->showAds(adInfo, _pos);
}
}
void TestAds::testHide(Object* pSender)
{
- _ads->hideAds(_type);
+ _ads->hideAds(adInfo);
}
void TestAds::menuBackCallback(Object* pSender)
{
if (_admob != NULL)
{
- _admob->hideAds(ProtocolAds::kBannerAd);
- _admob->hideAds(ProtocolAds::kFullScreenAd);
- _admob->hideAds(ProtocolAds::kMoreApp);
+ _admob->hideAds(adInfo);
PluginManager::getInstance()->unloadPlugin("AdsAdmob");
_admob = NULL;
}
@@ -219,13 +196,6 @@ void TestAds::caseChanged(Object* pSender)
log("case selected change to : %s", strLog.c_str());
}
-void TestAds::typeChanged(Object* pSender)
-{
- int selectIndex = _typeItem->getSelectedIndex();
- _type = (ProtocolAds::AdsType) selectIndex;
- log("type selected change to : %d", _type);
-}
-
void TestAds::posChanged(Object* pSender)
{
int selectIndex = _posItem->getSelectedIndex();
diff --git a/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.h b/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.h
index ab3e8af0b5..ffabe943f6 100644
--- a/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.h
+++ b/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.h
@@ -61,12 +61,12 @@ private:
MyAdsListener* _listener;
cocos2d::MenuItemToggle* _caseItem;
- cocos2d::MenuItemToggle* _typeItem;
cocos2d::MenuItemToggle* _posItem;
cocos2d::plugin::ProtocolAds* _ads;
cocos2d::plugin::ProtocolAds::AdsPos _pos;
- cocos2d::plugin::ProtocolAds::AdsType _type;
+
+ cocos2d::plugin::TAdsInfo adInfo;
};
#endif // __TEST_ADS_SCENE_H__
diff --git a/plugin/samples/HelloPlugins/Classes/TestAnalytics/TestAnalyticsScene.cpp b/plugin/samples/HelloPlugins/Classes/TestAnalytics/TestAnalyticsScene.cpp
index a27c210b85..a49d39051b 100644
--- a/plugin/samples/HelloPlugins/Classes/TestAnalytics/TestAnalyticsScene.cpp
+++ b/plugin/samples/HelloPlugins/Classes/TestAnalytics/TestAnalyticsScene.cpp
@@ -89,7 +89,7 @@ bool TestAnalytics::init()
Size visibleSize = Director::getInstance()->getVisibleSize();
Point origin = Director::getInstance()->getVisibleOrigin();
- Point posBR = ccp(origin.x + visibleSize.width, origin.y);
+ Point posBR = Point(origin.x + visibleSize.width, origin.y);
/////////////////////////////
// 2. add a menu item with "X" image, which is clicked to quit the program
@@ -98,7 +98,7 @@ bool TestAnalytics::init()
// add a "close" icon to exit the progress. it's an autorelease object
MenuItemFont *pBackItem = MenuItemFont::create("Back", CC_CALLBACK_1(TestAnalytics::menuBackCallback, this));
Size backSize = pBackItem->getContentSize();
- pBackItem->setPosition(ccpAdd(posBR, ccp(- backSize.width / 2, backSize.height / 2)));
+ pBackItem->setPosition(posBR + Point(- backSize.width / 2, backSize.height / 2));
// create menu, it's an autorelease object
Menu* pMenu = Menu::create(pBackItem, NULL);
@@ -111,15 +111,15 @@ bool TestAnalytics::init()
MenuItemLabel* pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(TestAnalytics::eventMenuCallback, this));
pMenu->addChild(pMenuItem, 0, s_EventMenuItem[i].tag);
yPos = visibleSize.height - 35*i - 100;
- pMenuItem->setPosition( ccp(visibleSize.width / 2, yPos));
+ pMenuItem->setPosition( Point(visibleSize.width / 2, yPos));
}
std::string strName = _pluginAnalytics->getPluginName();
std::string strVer = _pluginAnalytics->getSDKVersion();
char ret[256] = { 0 };
sprintf(ret, "Plugin : %s, Ver : %s", strName.c_str(), strVer.c_str());
- LabelTTF* pLabel = LabelTTF::create(ret, "Arial", 18, CCSizeMake(visibleSize.width, 0), kTextAlignmentCenter);
- pLabel->setPosition(ccp(visibleSize.width / 2, yPos - 80));
+ LabelTTF* pLabel = LabelTTF::create(ret, "Arial", 18, Point(visibleSize.width, 0), kTextAlignmentCenter);
+ pLabel->setPosition(Point(visibleSize.width / 2, yPos - 80));
addChild(pLabel);
return true;
@@ -225,7 +225,7 @@ void TestAnalytics::eventMenuCallback(Object* pSender)
void TestAnalytics::loadPlugins()
{
- ccLanguageType langType = Application::getInstance()->getCurrentLanguage();
+ LanguageType langType = Application::getInstance()->getCurrentLanguage();
std::string umengKey = "";
std::string flurryKey = "";
@@ -240,7 +240,7 @@ void TestAnalytics::loadPlugins()
flurryKey = FLURRY_KEY_ANDROID;
#endif
- if (kLanguageChinese == langType)
+ if (LanguageType::CHINESE == langType)
{
pluginName = "AnalyticsUmeng";
strAppKey = umengKey;
diff --git a/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.cpp b/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.cpp
index 0ad6da036c..02dcdb51e7 100644
--- a/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.cpp
+++ b/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.cpp
@@ -48,7 +48,7 @@ MyPurchase::~MyPurchase()
}
}
-MyPurchase* MyPurchase::sharedPurchase()
+MyPurchase* MyPurchase::getInstance()
{
if (s_pPurchase == NULL) {
s_pPurchase = new MyPurchase();
diff --git a/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.h b/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.h
index a5d2048864..8a52fbe19d 100644
--- a/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.h
+++ b/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.h
@@ -35,7 +35,7 @@ public:
class MyPurchase
{
public:
- static MyPurchase* sharedPurchase();
+ static MyPurchase* getInstance();
static void purgePurchase();
typedef enum {
diff --git a/plugin/samples/HelloPlugins/Classes/TestIAP/TestIAPScene.cpp b/plugin/samples/HelloPlugins/Classes/TestIAP/TestIAPScene.cpp
index 4d195d2952..217efd6b25 100644
--- a/plugin/samples/HelloPlugins/Classes/TestIAP/TestIAPScene.cpp
+++ b/plugin/samples/HelloPlugins/Classes/TestIAP/TestIAPScene.cpp
@@ -70,28 +70,28 @@ bool TestIAP::init()
return false;
}
- MyPurchase::sharedPurchase()->loadIAPPlugin();
+ MyPurchase::getInstance()->loadIAPPlugin();
/////////////////////////////
// 2. add a menu item with "X" image, which is clicked to quit the program
// you may modify it.
EGLView* pEGLView = EGLView::getInstance();
- Point posBR = ccp(pEGLView->getVisibleOrigin().x + pEGLView->getVisibleSize().width, pEGLView->getVisibleOrigin().y);
- Point posTL = ccp(pEGLView->getVisibleOrigin().x, pEGLView->getVisibleOrigin().y + pEGLView->getVisibleSize().height);
+ Point posBR = Point(pEGLView->getVisibleOrigin().x + pEGLView->getVisibleSize().width, pEGLView->getVisibleOrigin().y);
+ Point posTL = Point(pEGLView->getVisibleOrigin().x, pEGLView->getVisibleOrigin().y + pEGLView->getVisibleSize().height);
// add a "close" icon to exit the progress. it's an autorelease object
MenuItemFont *pBackItem = MenuItemFont::create("Back", CC_CALLBACK_1(TestIAP::menuBackCallback, this));
Size backSize = pBackItem->getContentSize();
- pBackItem->setPosition(ccpAdd(posBR, ccp(- backSize.width / 2, backSize.height / 2)));
+ pBackItem->setPosition(posBR + Point(- backSize.width / 2, backSize.height / 2));
// create menu, it's an autorelease object
Menu* pMenu = Menu::create(pBackItem, NULL);
pMenu->setPosition( Point::ZERO );
this->addChild(pMenu, 1);
- Point posStep = ccp(220, -150);
- Point beginPos = ccpAdd(posTL, ccpMult(posStep, 0.5f));
+ Point posStep = Point(220, -150);
+ Point beginPos = posTL + (posStep * 0.5f);
int line = 0;
int row = 0;
for (int i = 0; i < sizeof(s_EventMenuItem)/sizeof(s_EventMenuItem[0]); i++) {
@@ -99,13 +99,13 @@ bool TestIAP::init()
CC_CALLBACK_1(TestIAP::eventMenuCallback, this));
pMenu->addChild(pMenuItem, 0, s_EventMenuItem[i].tag);
- Point pos = ccpAdd(beginPos, ccp(posStep.x * row, posStep.y * line));
+ Point pos = beginPos + Point(posStep.x * row, posStep.y * line);
Size itemSize = pMenuItem->getContentSize();
if ((pos.x + itemSize.width / 2) > posBR.x)
{
line += 1;
row = 0;
- pos = ccpAdd(beginPos, ccp(posStep.x * row, posStep.y * line));
+ pos = beginPos + Point(posStep.x * row, posStep.y * line);
}
row += 1;
pMenuItem->setPosition(pos);
@@ -123,7 +123,7 @@ void TestIAP::eventMenuCallback(Object* pSender)
pInfo["productPrice"] = "0.01";
pInfo["productDesc"] = "100个金灿灿的游戏币哦";
pInfo["Nd91ProductId"] = "685994";
- MyPurchase::sharedPurchase()->payByMode(pInfo, mode);
+ MyPurchase::getInstance()->payByMode(pInfo, mode);
}
void TestIAP::menuBackCallback(Object* pSender)
diff --git a/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.cpp b/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.cpp
index 50551fda78..83da784f39 100644
--- a/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.cpp
+++ b/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.cpp
@@ -49,7 +49,7 @@ MyIAPOLManager::~MyIAPOLManager()
}
}
-MyIAPOLManager* MyIAPOLManager::sharedManager()
+MyIAPOLManager* MyIAPOLManager::getInstance()
{
if (s_pIAPOnline == NULL) {
s_pIAPOnline = new MyIAPOLManager();
diff --git a/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.h b/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.h
index b508cef1cf..f64749b01f 100644
--- a/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.h
+++ b/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.h
@@ -36,7 +36,7 @@ public:
class MyIAPOLManager
{
public:
- static MyIAPOLManager* sharedManager();
+ static MyIAPOLManager* getInstance();
static void purge();
typedef enum {
diff --git a/plugin/samples/HelloPlugins/Classes/TestIAPOnline/TestIAPOnlineScene.cpp b/plugin/samples/HelloPlugins/Classes/TestIAPOnline/TestIAPOnlineScene.cpp
index e8d59f9953..6a28504fa4 100644
--- a/plugin/samples/HelloPlugins/Classes/TestIAPOnline/TestIAPOnlineScene.cpp
+++ b/plugin/samples/HelloPlugins/Classes/TestIAPOnline/TestIAPOnlineScene.cpp
@@ -74,7 +74,7 @@ bool TestIAPOnline::init()
return false;
}
- MyIAPOLManager::sharedManager()->loadPlugins();
+ MyIAPOLManager::getInstance()->loadPlugins();
/////////////////////////////
// 2. add a menu item with "X" image, which is clicked to quit the program
@@ -130,10 +130,10 @@ void TestIAPOnline::eventMenuCallback(Object* pSender)
pInfo["Nd91ProductId"] = "685994";
if (mode == MyIAPOLManager::eQH360) {
- CCLog("To test the IAP online in plugin qh360, you should do this:");
- CCLog("1. Login by UserQH360");
- CCLog("2. Get QH360 user info by your game server (userID, AccessToken)");
- CCLog("3. Fill the product info");
+ log("To test the IAP online in plugin qh360, you should do this:");
+ log("1. Login by UserQH360");
+ log("2. Get QH360 user info by your game server (userID, AccessToken)");
+ log("3. Fill the product info");
/**
* @warning ProductInfo you need filled
@@ -153,7 +153,7 @@ void TestIAPOnline::eventMenuCallback(Object* pSender)
// pInfo["QHAppOrderID"] = "Order ID in game"; // The order ID in game (Game defined this)
}
- MyIAPOLManager::sharedManager()->payByMode(pInfo, mode);
+ MyIAPOLManager::getInstance()->payByMode(pInfo, mode);
}
void TestIAPOnline::menuBackCallback(Object* pSender)
diff --git a/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.cpp b/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.cpp
index 97f6d34174..11cd6a70aa 100644
--- a/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.cpp
+++ b/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.cpp
@@ -48,7 +48,7 @@ MyShareManager::~MyShareManager()
}
}
-MyShareManager* MyShareManager::sharedManager()
+MyShareManager* MyShareManager::getInstance()
{
if (s_pManager == NULL) {
s_pManager = new MyShareManager();
diff --git a/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.h b/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.h
index 4521a57b6c..cd8202f3a3 100755
--- a/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.h
+++ b/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.h
@@ -35,7 +35,7 @@ public:
class MyShareManager
{
public:
- static MyShareManager* sharedManager();
+ static MyShareManager* getInstance();
static void purgeManager();
typedef enum {
diff --git a/plugin/samples/HelloPlugins/Classes/TestShare/TestShareScene.cpp b/plugin/samples/HelloPlugins/Classes/TestShare/TestShareScene.cpp
index 1be29f9439..cf2a308f2c 100644
--- a/plugin/samples/HelloPlugins/Classes/TestShare/TestShareScene.cpp
+++ b/plugin/samples/HelloPlugins/Classes/TestShare/TestShareScene.cpp
@@ -70,7 +70,7 @@ bool TestShare::init()
return false;
}
- MyShareManager::sharedManager()->loadSharePlugin();
+ MyShareManager::getInstance()->loadSharePlugin();
/////////////////////////////
// 2. add a menu item with "X" image, which is clicked to quit the program
@@ -120,7 +120,7 @@ void TestShare::eventMenuCallback(Object* pSender)
pInfo["SharedText"] = "Share message : HelloShare!";
// pInfo["SharedImagePath"] = "Full/path/to/image";
MyShareManager::MyShareMode mode = (MyShareManager::MyShareMode) (pMenuItem->getTag() - TAG_SHARE_BY_TWWITER + 1);
- MyShareManager::sharedManager()->shareByMode(pInfo, mode);
+ MyShareManager::getInstance()->shareByMode(pInfo, mode);
}
void TestShare::menuBackCallback(Object* pSender)
diff --git a/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.cpp b/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.cpp
index 97ed27f872..21d790296a 100644
--- a/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.cpp
+++ b/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.cpp
@@ -41,7 +41,7 @@ MySocialManager::~MySocialManager()
unloadPlugins();
}
-MySocialManager* MySocialManager::sharedManager()
+MySocialManager* MySocialManager::getInstance()
{
if (s_pManager == NULL) {
s_pManager = new MySocialManager();
diff --git a/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.h b/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.h
index 69cfee5bba..4df5026163 100755
--- a/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.h
+++ b/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.h
@@ -29,7 +29,7 @@ THE SOFTWARE.
class MySocialManager : public cocos2d::plugin::SocialListener
{
public:
- static MySocialManager* sharedManager();
+ static MySocialManager* getInstance();
static void purgeManager();
typedef enum {
diff --git a/plugin/samples/HelloPlugins/Classes/TestSocial/TestSocialScene.cpp b/plugin/samples/HelloPlugins/Classes/TestSocial/TestSocialScene.cpp
index 2415ca6dd9..a8f1c7e9e3 100644
--- a/plugin/samples/HelloPlugins/Classes/TestSocial/TestSocialScene.cpp
+++ b/plugin/samples/HelloPlugins/Classes/TestSocial/TestSocialScene.cpp
@@ -59,7 +59,7 @@ bool TestSocial::init()
return false;
}
- MySocialManager::sharedManager()->loadPlugins();
+ MySocialManager::getInstance()->loadPlugins();
Size visibleSize = Director::getInstance()->getVisibleSize();
Point origin = Director::getInstance()->getVisibleOrigin();
@@ -119,7 +119,7 @@ bool TestSocial::init()
void TestSocial::testSubmit(Object* pSender)
{
int nIdx = _caseItem->getSelectedIndex();
- MySocialManager::sharedManager()->submitScore((MySocialManager::MySocialMode)(nIdx + 1), "0", 30000);
+ MySocialManager::getInstance()->submitScore((MySocialManager::MySocialMode)(nIdx + 1), "0", 30000);
}
void TestSocial::testUnlock(Object* pSender)
@@ -129,19 +129,19 @@ void TestSocial::testUnlock(Object* pSender)
info["AchievementID"] = "MyAchiID";
info["NDDisplayText"] = "Fighter";
info["NDScore"] = "100";
- MySocialManager::sharedManager()->unlockAchievement((MySocialManager::MySocialMode)(nIdx + 1), info);
+ MySocialManager::getInstance()->unlockAchievement((MySocialManager::MySocialMode)(nIdx + 1), info);
}
void TestSocial::testLeaderboard(Object* pSender)
{
int nIdx = _caseItem->getSelectedIndex();
- MySocialManager::sharedManager()->showLeaderboard((MySocialManager::MySocialMode)(nIdx + 1), "0");
+ MySocialManager::getInstance()->showLeaderboard((MySocialManager::MySocialMode)(nIdx + 1), "0");
}
void TestSocial::testAchievement(Object* pSender)
{
int nIdx = _caseItem->getSelectedIndex();
- MySocialManager::sharedManager()->showAchievement((MySocialManager::MySocialMode)(nIdx + 1));
+ MySocialManager::getInstance()->showAchievement((MySocialManager::MySocialMode)(nIdx + 1));
}
void TestSocial::menuBackCallback(Object* pSender)
diff --git a/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.cpp b/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.cpp
index 8a8836b75f..456b525969 100644
--- a/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.cpp
+++ b/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.cpp
@@ -49,7 +49,7 @@ MyUserManager::~MyUserManager()
}
}
-MyUserManager* MyUserManager::sharedManager()
+MyUserManager* MyUserManager::getInstance()
{
if (s_pManager == NULL) {
s_pManager = new MyUserManager();
diff --git a/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.h b/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.h
index 721367661d..83ad696372 100755
--- a/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.h
+++ b/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.h
@@ -36,7 +36,7 @@ public:
class MyUserManager
{
public:
- static MyUserManager* sharedManager();
+ static MyUserManager* getInstance();
static void purgeManager();
typedef enum {
diff --git a/plugin/samples/HelloPlugins/Classes/TestUser/TestUserScene.cpp b/plugin/samples/HelloPlugins/Classes/TestUser/TestUserScene.cpp
index 20aa643c1a..aebb5d2e0a 100644
--- a/plugin/samples/HelloPlugins/Classes/TestUser/TestUserScene.cpp
+++ b/plugin/samples/HelloPlugins/Classes/TestUser/TestUserScene.cpp
@@ -60,7 +60,7 @@ bool TestUser::init()
return false;
}
- MyUserManager::sharedManager()->loadPlugin();
+ MyUserManager::getInstance()->loadPlugin();
Size visibleSize = Director::getInstance()->getVisibleSize();
Point origin = Director::getInstance()->getVisibleOrigin();
Point posMid = Point(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2);
@@ -117,12 +117,12 @@ void TestUser::caseChanged(Object* pSender)
void TestUser::testLogin(Object* pSender)
{
- MyUserManager::sharedManager()->loginByMode((MyUserManager::MyUserMode) (_selectedCase + 1));
+ MyUserManager::getInstance()->loginByMode((MyUserManager::MyUserMode) (_selectedCase + 1));
}
void TestUser::testLogout(Object* pSender)
{
- MyUserManager::sharedManager()->logoutByMode((MyUserManager::MyUserMode) (_selectedCase + 1));
+ MyUserManager::getInstance()->logoutByMode((MyUserManager::MyUserMode) (_selectedCase + 1));
}
void TestUser::menuBackCallback(Object* pSender)
diff --git a/plugin/samples/HelloPlugins/proj.android/jni/hellocpp/main.cpp b/plugin/samples/HelloPlugins/proj.android/jni/hellocpp/main.cpp
index 5a68d26107..947a965512 100644
--- a/plugin/samples/HelloPlugins/proj.android/jni/hellocpp/main.cpp
+++ b/plugin/samples/HelloPlugins/proj.android/jni/hellocpp/main.cpp
@@ -33,9 +33,9 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
}
else
{
- ccGLInvalidateStateCache();
+ GL::invalidateStateCache();
ShaderCache::getInstance()->reloadDefaultShaders();
- ccDrawInit();
+ DrawPrimitives::init();
TextureCache::reloadAllTextures();
NotificationCenter::getInstance()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
Director::getInstance()->setGLDefaultValues();
diff --git a/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.cpp b/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.cpp
index 95c96b8473..5ed803826a 100644
--- a/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.cpp
+++ b/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.cpp
@@ -61,16 +61,16 @@ bool AppDelegate::applicationDidFinishLaunching()
void AppDelegate::applicationDidEnterBackground()
{
Director::getInstance()->stopAnimation();
- SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
- SimpleAudioEngine::sharedEngine()->pauseAllEffects();
+ SimpleAudioEngine::getInstance()->pauseBackgroundMusic();
+ SimpleAudioEngine::getInstance()->pauseAllEffects();
}
// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground()
{
Director::getInstance()->startAnimation();
- SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
- SimpleAudioEngine::sharedEngine()->resumeAllEffects();
+ SimpleAudioEngine::getInstance()->resumeBackgroundMusic();
+ SimpleAudioEngine::getInstance()->resumeAllEffects();
}
UpdateLayer::UpdateLayer()
@@ -149,16 +149,16 @@ bool UpdateLayer::init()
pItemEnter = MenuItemFont::create("enter", CC_CALLBACK_1(UpdateLayer::enter, this));
pItemUpdate = MenuItemFont::create("update", CC_CALLBACK_1(UpdateLayer::update, this));
- pItemEnter->setPosition(ccp(size.width/2, size.height/2 + 50));
- pItemReset->setPosition(ccp(size.width/2, size.height/2));
- pItemUpdate->setPosition(ccp(size.width/2, size.height/2 - 50));
+ pItemEnter->setPosition(Point(size.width/2, size.height/2 + 50));
+ pItemReset->setPosition(Point(size.width/2, size.height/2));
+ pItemUpdate->setPosition(Point(size.width/2, size.height/2 - 50));
Menu *menu = Menu::create(pItemUpdate, pItemEnter, pItemReset, NULL);
- menu->setPosition(ccp(0,0));
+ menu->setPosition(Point(0,0));
addChild(menu);
pProgressLabel = LabelTTF::create("", "Arial", 20);
- pProgressLabel->setPosition(ccp(100, 50));
+ pProgressLabel->setPosition(Point(100, 50));
addChild(pProgressLabel);
return true;
diff --git a/samples/Cpp/AssetsManagerTest/proj.android/build_native.sh b/samples/Cpp/AssetsManagerTest/proj.android/build_native.sh
index 15e1e45299..12e6564c5b 100755
--- a/samples/Cpp/AssetsManagerTest/proj.android/build_native.sh
+++ b/samples/Cpp/AssetsManagerTest/proj.android/build_native.sh
@@ -51,7 +51,7 @@ fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# ... use paths relative to current directory
-COCOS2DX_ROOT="../../../../"
+COCOS2DX_ROOT="$DIR/../../../.."
APP_ROOT="$DIR/.."
APP_ANDROID_ROOT="$DIR"
BINDINGS_JS_ROOT="$APP_ROOT/../../../scripting/javascript/bindings/js"
diff --git a/samples/Cpp/AssetsManagerTest/proj.android/jni/hellocpp/main.cpp b/samples/Cpp/AssetsManagerTest/proj.android/jni/hellocpp/main.cpp
index ac6f58ba07..19c9a02d06 100644
--- a/samples/Cpp/AssetsManagerTest/proj.android/jni/hellocpp/main.cpp
+++ b/samples/Cpp/AssetsManagerTest/proj.android/jni/hellocpp/main.cpp
@@ -30,9 +30,9 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
}
else
{
- ccGLInvalidateStateCache();
+ GL::invalidateStateCache();
ShaderCache::getInstance()->reloadDefaultShaders();
- ccDrawInit();
+ DrawPrimitives::init();
TextureCache::reloadAllTextures();
NotificationCenter::getInstance()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
Director::getInstance()->setGLDefaultValues();
diff --git a/samples/Cpp/HelloCpp/Classes/AppDelegate.cpp b/samples/Cpp/HelloCpp/Classes/AppDelegate.cpp
index b22c7e8a6e..0be3f40794 100644
--- a/samples/Cpp/HelloCpp/Classes/AppDelegate.cpp
+++ b/samples/Cpp/HelloCpp/Classes/AppDelegate.cpp
@@ -27,7 +27,7 @@ bool AppDelegate::applicationDidFinishLaunching() {
Size size = director->getWinSize();
// Set the design resolution
- glView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionNoBorder);
+ glView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);
Size frameSize = glView->getFrameSize();
diff --git a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp b/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp
index b00c3184c1..e07234d078 100644
--- a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp
+++ b/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp
@@ -77,7 +77,7 @@ bool HelloWorld::init()
}
-void HelloWorld::menuCloseCallback(Object* pSender)
+void HelloWorld::menuCloseCallback(Object* sender)
{
Director::getInstance()->end();
diff --git a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.h b/samples/Cpp/HelloCpp/Classes/HelloWorldScene.h
index 45139f9d67..876073cdb5 100644
--- a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.h
+++ b/samples/Cpp/HelloCpp/Classes/HelloWorldScene.h
@@ -13,7 +13,7 @@ public:
static cocos2d::Scene* scene();
// a selector callback
- void menuCloseCallback(Object* pSender);
+ void menuCloseCallback(Object* sender);
// implement the "static node()" method manually
CREATE_FUNC(HelloWorld);
diff --git a/samples/Cpp/HelloCpp/proj.android/jni/hellocpp/main.cpp b/samples/Cpp/HelloCpp/proj.android/jni/hellocpp/main.cpp
index 7d495c10a1..8a40310b9c 100644
--- a/samples/Cpp/HelloCpp/proj.android/jni/hellocpp/main.cpp
+++ b/samples/Cpp/HelloCpp/proj.android/jni/hellocpp/main.cpp
@@ -32,9 +32,9 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
}
else
{
- ccGLInvalidateStateCache();
+ GL::invalidateStateCache();
ShaderCache::getInstance()->reloadDefaultShaders();
- ccDrawInit();
+ DrawPrimitives::init();
TextureCache::reloadAllTextures();
NotificationCenter::getInstance()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
Director::getInstance()->setGLDefaultValues();
diff --git a/samples/Cpp/HelloCpp/proj.emscripten/Makefile b/samples/Cpp/HelloCpp/proj.emscripten/Makefile
index 9e47a17ce9..56bb3d7df1 100644
--- a/samples/Cpp/HelloCpp/proj.emscripten/Makefile
+++ b/samples/Cpp/HelloCpp/proj.emscripten/Makefile
@@ -26,9 +26,9 @@ $(TARGET).js: $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST)
ifeq ($(shell uname -s),Darwin)
-ARIEL_TTF := /Library/Fonts/Arial.ttf
+ARIAL_TTF := /Library/Fonts/Arial.ttf
else
-ARIEL_TTF := $(COCOS_ROOT)/samples/Cpp/TestCpp/Resources/fonts/arial.ttf
+ARIAL_TTF := $(COCOS_ROOT)/samples/Cpp/TestCpp/Resources/fonts/arial.ttf
endif
$(TARGET).data:
@@ -39,15 +39,16 @@ $(TARGET).data:
(cd $(RESOURCE_PATH) && cp -a $(RESOURCES) $(RESTMP))
(cd $(FONT_PATH) && cp -a * $(RESTMP)/fonts)
# NOTE: we copy the system arial.ttf so that there is always a fallback.
- cp $(ARIEL_TTF) $(RESTMP)/fonts/arial.ttf
+ cp $(ARIAL_TTF) $(RESTMP)/fonts/arial.ttf
(cd $(RESTMP); python $(PACKAGER) $(EXECUTABLE).data $(patsubst %,--preload %,$(RESOURCES)) --preload fonts --pre-run > $(EXECUTABLE).data.js)
mv $(RESTMP)/$(EXECUTABLE).data $@
mv $(RESTMP)/$(EXECUTABLE).data.js $@.js
rm -rf $(RESTMP)
-$(BIN_DIR)/index.html: index.html
+$(BIN_DIR)/$(HTMLTPL_FILE): $(HTMLTPL_DIR)/$(HTMLTPL_FILE)
@mkdir -p $(@D)
- cp index.html $(@D)
+ @cp -Rf $(HTMLTPL_DIR)/* $(BIN_DIR)
+ @sed -i -e "s/JS_APPLICATION/$(EXECUTABLE)/g" $(BIN_DIR)/$(HTMLTPL_FILE)
$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
diff --git a/samples/Cpp/HelloCpp/proj.emscripten/index.html b/samples/Cpp/HelloCpp/proj.emscripten/index.html
deleted file mode 100644
index b8befe726a..0000000000
--- a/samples/Cpp/HelloCpp/proj.emscripten/index.html
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
- Emscripten-Generated Code
-
-
-
-
- Downloading...
-
-
-
-
-
-
- Resize canvas
- Lock/hide mouse pointer
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/Cpp/SimpleGame/Classes/AppDelegate.cpp b/samples/Cpp/SimpleGame/Classes/AppDelegate.cpp
index 961f517e43..c1f7b09f90 100644
--- a/samples/Cpp/SimpleGame/Classes/AppDelegate.cpp
+++ b/samples/Cpp/SimpleGame/Classes/AppDelegate.cpp
@@ -36,7 +36,7 @@ bool AppDelegate::applicationDidFinishLaunching() {
FileUtils::getInstance()->setSearchPaths(searchPaths);
- EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionNoBorder);
+ EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER);
// turn on display FPS
director->setDisplayStats(true);
diff --git a/samples/Cpp/SimpleGame/Classes/HelloWorldScene.cpp b/samples/Cpp/SimpleGame/Classes/HelloWorldScene.cpp
index 2f2ed57017..9b7cc00c3a 100644
--- a/samples/Cpp/SimpleGame/Classes/HelloWorldScene.cpp
+++ b/samples/Cpp/SimpleGame/Classes/HelloWorldScene.cpp
@@ -117,7 +117,7 @@ bool HelloWorld::init()
return bRet;
}
-void HelloWorld::menuCloseCallback(Object* pSender)
+void HelloWorld::menuCloseCallback(Object* sender)
{
// "close" menu item clicked
Director::getInstance()->end();
@@ -190,7 +190,7 @@ void HelloWorld::gameLogic(float dt)
void HelloWorld::ccTouchesEnded(Set* touches, Event* event)
{
// Choose one of the touches to work with
- Touch* touch = (Touch*)( touches->anyObject() );
+ Touch* touch = static_cast( touches->anyObject() );
Point location = touch->getLocation();
log("++++++++after x:%f, y:%f", location.x, location.y);
diff --git a/samples/Cpp/SimpleGame/Classes/HelloWorldScene.h b/samples/Cpp/SimpleGame/Classes/HelloWorldScene.h
index be943b4724..bb5ac961dc 100644
--- a/samples/Cpp/SimpleGame/Classes/HelloWorldScene.h
+++ b/samples/Cpp/SimpleGame/Classes/HelloWorldScene.h
@@ -19,7 +19,7 @@ public:
static cocos2d::Scene* scene();
// a selector callback
- virtual void menuCloseCallback(cocos2d::Object* pSender);
+ virtual void menuCloseCallback(cocos2d::Object* sender);
// implement the "static node()" method manually
CREATE_FUNC(HelloWorld);
diff --git a/samples/Cpp/SimpleGame/proj.android/jni/hellocpp/main.cpp b/samples/Cpp/SimpleGame/proj.android/jni/hellocpp/main.cpp
index e8639bcc2d..eaef41aa5a 100644
--- a/samples/Cpp/SimpleGame/proj.android/jni/hellocpp/main.cpp
+++ b/samples/Cpp/SimpleGame/proj.android/jni/hellocpp/main.cpp
@@ -32,9 +32,9 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
}
else
{
- ccGLInvalidateStateCache();
+ GL::invalidateStateCache();
ShaderCache::getInstance()->reloadDefaultShaders();
- ccDrawInit();
+ DrawPrimitives::init();
TextureCache::reloadAllTextures();
NotificationCenter::getInstance()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
Director::getInstance()->setGLDefaultValues();
diff --git a/samples/Cpp/SimpleGame/proj.emscripten/Makefile b/samples/Cpp/SimpleGame/proj.emscripten/Makefile
index 39559056f2..cc538b4d65 100644
--- a/samples/Cpp/SimpleGame/proj.emscripten/Makefile
+++ b/samples/Cpp/SimpleGame/proj.emscripten/Makefile
@@ -57,9 +57,10 @@ $(TARGET).data:
mv $(RESTMP)/$(EXECUTABLE).data.js $@.js
rm -rf $(RESTMP)
-$(BIN_DIR)/index.html: index.html
+$(BIN_DIR)/$(HTMLTPL_FILE): $(HTMLTPL_DIR)/$(HTMLTPL_FILE)
@mkdir -p $(@D)
- cp index.html $(@D)
+ @cp -Rf $(HTMLTPL_DIR)/* $(BIN_DIR)
+ @sed -i -e "s/JS_APPLICATION/$(EXECUTABLE)/g" $(BIN_DIR)/$(HTMLTPL_FILE)
$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
diff --git a/samples/Cpp/SimpleGame/proj.emscripten/index.html b/samples/Cpp/SimpleGame/proj.emscripten/index.html
deleted file mode 100644
index a78af31af6..0000000000
--- a/samples/Cpp/SimpleGame/proj.emscripten/index.html
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
- SimpleGame
-
-
-
-
- Downloading...
-
-
-
-
-
-
- Resize canvas
- Lock/hide mouse pointer
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.cpp b/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.cpp
index 9260a12bb9..66cb282165 100644
--- a/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.cpp
@@ -82,7 +82,7 @@ std::string ActionManagerTest::title()
return "No title";
}
-void ActionManagerTest::restartCallback(Object* pSender)
+void ActionManagerTest::restartCallback(Object* sender)
{
Scene* s = new ActionManagerTestScene();
s->addChild(restartActionManagerAction());
@@ -91,7 +91,7 @@ void ActionManagerTest::restartCallback(Object* pSender)
s->release();
}
-void ActionManagerTest::nextCallback(Object* pSender)
+void ActionManagerTest::nextCallback(Object* sender)
{
Scene* s = new ActionManagerTestScene();
s->addChild( nextActionManagerAction() );
@@ -99,7 +99,7 @@ void ActionManagerTest::nextCallback(Object* pSender)
s->release();
}
-void ActionManagerTest::backCallback(Object* pSender)
+void ActionManagerTest::backCallback(Object* sender)
{
Scene* s = new ActionManagerTestScene();
s->addChild( backActionManagerAction() );
diff --git a/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.h b/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.h
index 6e0a3c8522..946c2f4b38 100644
--- a/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.h
+++ b/samples/Cpp/TestCpp/Classes/ActionManagerTest/ActionManagerTest.h
@@ -17,9 +17,9 @@ public:
virtual std::string title();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
};
class CrashTest : public ActionManagerTest
diff --git a/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp b/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp
index da9e8fa250..b9c6e14145 100644
--- a/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp
@@ -622,7 +622,7 @@ void EaseSpriteDemo::onEnter()
_tamara->setPosition(Point(VisibleRect::left().x + 60, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height*4/5));
}
-void EaseSpriteDemo::restartCallback(Object* pSender)
+void EaseSpriteDemo::restartCallback(Object* sender)
{
Scene* s = new ActionsEaseTestScene();//CCScene::create();
s->addChild(restartEaseAction());
@@ -631,7 +631,7 @@ void EaseSpriteDemo::restartCallback(Object* pSender)
s->release();
}
-void EaseSpriteDemo::nextCallback(Object* pSender)
+void EaseSpriteDemo::nextCallback(Object* sender)
{
Scene* s = new ActionsEaseTestScene();//CCScene::create();
s->addChild( nextEaseAction() );
@@ -639,7 +639,7 @@ void EaseSpriteDemo::nextCallback(Object* pSender)
s->release();
}
-void EaseSpriteDemo::backCallback(Object* pSender)
+void EaseSpriteDemo::backCallback(Object* sender)
{
Scene* s = new ActionsEaseTestScene();//CCScene::create();
s->addChild( backEaseAction() );
diff --git a/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.h b/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.h
index 3ea8b23bec..e202402688 100644
--- a/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.h
+++ b/samples/Cpp/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.h
@@ -23,9 +23,9 @@ public:
virtual std::string title();
virtual void onEnter();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
void positionForTwo();
};
diff --git a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp b/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp
index 8585e62243..5f904e8f7b 100644
--- a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp
@@ -96,7 +96,7 @@ void SpriteDemo::onEnter()
addChild(background, -10);
}
-void SpriteDemo::restartCallback(Object* pSender)
+void SpriteDemo::restartCallback(Object* sender)
{
Scene* s = new ProgressActionsTestScene();
s->addChild(restartAction());
@@ -105,7 +105,7 @@ void SpriteDemo::restartCallback(Object* pSender)
s->release();
}
-void SpriteDemo::nextCallback(Object* pSender)
+void SpriteDemo::nextCallback(Object* sender)
{
Scene* s = new ProgressActionsTestScene();
s->addChild( nextAction() );
@@ -113,7 +113,7 @@ void SpriteDemo::nextCallback(Object* pSender)
s->release();
}
-void SpriteDemo::backCallback(Object* pSender)
+void SpriteDemo::backCallback(Object* sender)
{
Scene* s = new ProgressActionsTestScene();
s->addChild( backAction() );
@@ -136,13 +136,13 @@ void SpriteProgressToRadial::onEnter()
ProgressTo *to2 = ProgressTo::create(2, 100);
ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathSister1));
- left->setType( kProgressTimerTypeRadial );
+ left->setType( ProgressTimer::Type::RADIAL );
addChild(left);
left->setPosition(Point(100, s.height/2));
left->runAction( RepeatForever::create(to1));
ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathBlock));
- right->setType(kProgressTimerTypeRadial);
+ right->setType(ProgressTimer::Type::RADIAL);
// Makes the ridial CCW
right->setReverseProgress(true);
addChild(right);
@@ -171,7 +171,7 @@ void SpriteProgressToHorizontal::onEnter()
ProgressTo *to2 = ProgressTo::create(2, 100);
ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathSister1));
- left->setType(kProgressTimerTypeBar);
+ left->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the left since the midpoint is 0 for the x
left->setMidpoint(Point(0,0));
// Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change
@@ -181,7 +181,7 @@ void SpriteProgressToHorizontal::onEnter()
left->runAction( RepeatForever::create(to1));
ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathSister2));
- right->setType(kProgressTimerTypeBar);
+ right->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the left since the midpoint is 1 for the x
right->setMidpoint(Point(1, 0));
// Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change
@@ -211,7 +211,7 @@ void SpriteProgressToVertical::onEnter()
ProgressTo *to2 = ProgressTo::create(2, 100);
ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathSister1));
- left->setType(kProgressTimerTypeBar);
+ left->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y
left->setMidpoint(Point(0,0));
@@ -222,7 +222,7 @@ void SpriteProgressToVertical::onEnter()
left->runAction( RepeatForever::create(to1));
ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathSister2));
- right->setType(kProgressTimerTypeBar);
+ right->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y
right->setMidpoint(Point(0, 1));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
@@ -254,7 +254,7 @@ void SpriteProgressToRadialMidpointChanged::onEnter()
* Our image on the left should be a radial progress indicator, clockwise
*/
ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathBlock));
- left->setType(kProgressTimerTypeRadial);
+ left->setType(ProgressTimer::Type::RADIAL);
addChild(left);
left->setMidpoint(Point(0.25f, 0.75f));
left->setPosition(Point(100, s.height/2));
@@ -264,7 +264,7 @@ void SpriteProgressToRadialMidpointChanged::onEnter()
* Our image on the left should be a radial progress indicator, counter clockwise
*/
ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathBlock));
- right->setType(kProgressTimerTypeRadial);
+ right->setType(ProgressTimer::Type::RADIAL);
right->setMidpoint(Point(0.75f, 0.25f));
/**
@@ -295,7 +295,7 @@ void SpriteProgressBarVarious::onEnter()
ProgressTo *to = ProgressTo::create(2, 100);
ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathSister1));
- left->setType(kProgressTimerTypeBar);
+ left->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y
left->setMidpoint(Point(0.5f, 0.5f));
@@ -306,7 +306,7 @@ void SpriteProgressBarVarious::onEnter()
left->runAction(RepeatForever::create(to->clone()));
ProgressTimer *middle = ProgressTimer::create(Sprite::create(s_pathSister2));
- middle->setType(kProgressTimerTypeBar);
+ middle->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y
middle->setMidpoint(Point(0.5f, 0.5f));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
@@ -316,7 +316,7 @@ void SpriteProgressBarVarious::onEnter()
middle->runAction(RepeatForever::create(to->clone()));
ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathSister2));
- right->setType(kProgressTimerTypeBar);
+ right->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y
right->setMidpoint(Point(0.5f, 0.5f));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
@@ -352,7 +352,7 @@ void SpriteProgressBarTintAndFade::onEnter()
NULL);
ProgressTimer *left = ProgressTimer::create(Sprite::create(s_pathSister1));
- left->setType(kProgressTimerTypeBar);
+ left->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y
left->setMidpoint(Point(0.5f, 0.5f));
@@ -366,7 +366,7 @@ void SpriteProgressBarTintAndFade::onEnter()
left->addChild(LabelTTF::create("Tint", "Marker Felt", 20.0f));
ProgressTimer *middle = ProgressTimer::create(Sprite::create(s_pathSister2));
- middle->setType(kProgressTimerTypeBar);
+ middle->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y
middle->setMidpoint(Point(0.5f, 0.5f));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
@@ -379,7 +379,7 @@ void SpriteProgressBarTintAndFade::onEnter()
middle->addChild(LabelTTF::create("Fade", "Marker Felt", 20.0f));
ProgressTimer *right = ProgressTimer::create(Sprite::create(s_pathSister2));
- right->setType(kProgressTimerTypeBar);
+ right->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y
right->setMidpoint(Point(0.5f, 0.5f));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
@@ -414,7 +414,7 @@ void SpriteProgressWithSpriteFrame::onEnter()
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("zwoptex/grossini.plist");
ProgressTimer *left = ProgressTimer::create(Sprite::createWithSpriteFrameName("grossini_dance_01.png"));
- left->setType(kProgressTimerTypeBar);
+ left->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y
left->setMidpoint(Point(0.5f, 0.5f));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
@@ -424,7 +424,7 @@ void SpriteProgressWithSpriteFrame::onEnter()
left->runAction(RepeatForever::create(to->clone()));
ProgressTimer *middle = ProgressTimer::create(Sprite::createWithSpriteFrameName("grossini_dance_02.png"));
- middle->setType(kProgressTimerTypeBar);
+ middle->setType(ProgressTimer::Type::BAR);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y
middle->setMidpoint(Point(0.5f, 0.5f));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
@@ -434,7 +434,7 @@ void SpriteProgressWithSpriteFrame::onEnter()
middle->runAction(RepeatForever::create(to->clone()));
ProgressTimer *right = ProgressTimer::create(Sprite::createWithSpriteFrameName("grossini_dance_03.png"));
- right->setType(kProgressTimerTypeRadial);
+ right->setType(ProgressTimer::Type::RADIAL);
// Setup for a bar starting from the bottom since the midpoint is 0 for the y
right->setMidpoint(Point(0.5f, 0.5f));
// Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
diff --git a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.h b/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.h
index 54e6183b27..37b780be51 100644
--- a/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.h
+++ b/samples/Cpp/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.h
@@ -14,9 +14,9 @@ public:
virtual std::string subtitle();
virtual void onEnter();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
};
class SpriteProgressToRadial : public SpriteDemo
diff --git a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp b/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp
index 8a956cd992..2f1f0b3907 100644
--- a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp
@@ -142,7 +142,7 @@ void ActionsDemo::onExit()
BaseTest::onExit();
}
-void ActionsDemo::restartCallback(Object* pSender)
+void ActionsDemo::restartCallback(Object* sender)
{
Scene* s = new ActionsTestScene();
s->addChild( restartAction() );
@@ -150,7 +150,7 @@ void ActionsDemo::restartCallback(Object* pSender)
s->release();
}
-void ActionsDemo::nextCallback(Object* pSender)
+void ActionsDemo::nextCallback(Object* sender)
{
Scene* s = new ActionsTestScene();
s->addChild( nextAction() );
@@ -158,7 +158,7 @@ void ActionsDemo::nextCallback(Object* pSender)
s->release();
}
-void ActionsDemo::backCallback(Object* pSender)
+void ActionsDemo::backCallback(Object* sender)
{
Scene* s = new ActionsTestScene();
s->addChild( backAction() );
@@ -852,7 +852,7 @@ std::string ActionCallFuncND::subtitle()
return "simulates CallFuncND with std::bind()";
}
-void ActionCallFuncND::doRemoveFromParentAndCleanup(Node* pSender, bool cleanup)
+void ActionCallFuncND::doRemoveFromParentAndCleanup(Node* sender, bool cleanup)
{
_grossini->removeFromParentAndCleanup(cleanup);
}
@@ -1013,11 +1013,11 @@ void ActionRepeatForever::onEnter()
_grossini->runAction(action);
}
-void ActionRepeatForever::repeatForever(Node* pSender)
+void ActionRepeatForever::repeatForever(Node* sender)
{
auto repeat = RepeatForever::create( RotateBy::create(1.0f, 360) );
- pSender->runAction(repeat);
+ sender->runAction(repeat);
}
std::string ActionRepeatForever::subtitle()
@@ -1297,7 +1297,7 @@ void ActionFollow::draw()
float y = winSize.height;
Point vertices[] = { Point(5,5), Point(x-5,5), Point(x-5,y-5), Point(5,y-5) };
- ccDrawPoly(vertices, 4, true);
+ DrawPrimitives::drawPoly(vertices, 4, true);
}
std::string ActionFollow::subtitle()
@@ -1565,10 +1565,10 @@ void ActionCatmullRomStacked::draw()
// move to 50,50 since the "by" path will start at 50,50
kmGLPushMatrix();
kmGLTranslatef(50, 50, 0);
- ccDrawCatmullRom(_array1,50);
+ DrawPrimitives::drawCatmullRom(_array1,50);
kmGLPopMatrix();
- ccDrawCatmullRom(_array2,50);
+ DrawPrimitives::drawCatmullRom(_array2,50);
}
std::string ActionCatmullRomStacked::title()
@@ -1660,14 +1660,14 @@ void ActionCardinalSplineStacked::draw()
// move to 50,50 since the "by" path will start at 50,50
kmGLPushMatrix();
kmGLTranslatef(50, 50, 0);
- ccDrawCardinalSpline(_array, 0, 100);
+ DrawPrimitives::drawCardinalSpline(_array, 0, 100);
kmGLPopMatrix();
auto s = Director::getInstance()->getWinSize();
kmGLPushMatrix();
kmGLTranslatef(s.width/2, 50, 0);
- ccDrawCardinalSpline(_array, 1, 100);
+ DrawPrimitives::drawCardinalSpline(_array, 1, 100);
kmGLPopMatrix();
}
@@ -1700,7 +1700,7 @@ void Issue1305::onEnter()
scheduleOnce(schedule_selector(Issue1305::addSprite), 2);
}
-void Issue1305::log(Node* pSender)
+void Issue1305::log(Node* sender)
{
cocos2d::log("This message SHALL ONLY appear when the sprite is added to the scene, NOT BEFORE");
}
@@ -1885,9 +1885,9 @@ std::string Issue1327::subtitle()
return "See console: You should see: 0, 45, 90, 135, 180";
}
-void Issue1327::logSprRotation(Sprite* pSender)
+void Issue1327::logSprRotation(Sprite* sender)
{
- log("%f", pSender->getRotation());
+ log("%f", sender->getRotation());
}
//Issue1398
@@ -2012,10 +2012,10 @@ void ActionCatmullRom::draw()
// move to 50,50 since the "by" path will start at 50,50
kmGLPushMatrix();
kmGLTranslatef(50, 50, 0);
- ccDrawCatmullRom(_array1, 50);
+ DrawPrimitives::drawCatmullRom(_array1, 50);
kmGLPopMatrix();
- ccDrawCatmullRom(_array2,50);
+ DrawPrimitives::drawCatmullRom(_array2,50);
}
string ActionCatmullRom::title()
@@ -2090,14 +2090,14 @@ void ActionCardinalSpline::draw()
// move to 50,50 since the "by" path will start at 50,50
kmGLPushMatrix();
kmGLTranslatef(50, 50, 0);
- ccDrawCardinalSpline(_array, 0, 100);
+ DrawPrimitives::drawCardinalSpline(_array, 0, 100);
kmGLPopMatrix();
auto s = Director::getInstance()->getWinSize();
kmGLPushMatrix();
kmGLTranslatef(s.width/2, 50, 0);
- ccDrawCardinalSpline(_array, 1, 100);
+ DrawPrimitives::drawCardinalSpline(_array, 1, 100);
kmGLPopMatrix();
}
diff --git a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.h b/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.h
index 737e1f5502..facb2a01cc 100644
--- a/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.h
+++ b/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.h
@@ -32,9 +32,9 @@ public:
virtual std::string title();
virtual std::string subtitle();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
};
class ActionManual : public ActionsDemo
@@ -240,7 +240,7 @@ public:
virtual void onEnter();
virtual std::string title();
virtual std::string subtitle();
- void callback(Node* pSender);
+ void callback(Node* sender);
};
class ActionCallFuncND : public ActionsDemo
@@ -249,7 +249,7 @@ public:
virtual void onEnter();
virtual std::string title();
virtual std::string subtitle();
- void doRemoveFromParentAndCleanup(Node* pSender, bool cleanup);
+ void doRemoveFromParentAndCleanup(Node* sender, bool cleanup);
};
class ActionCallFuncO : public ActionsDemo
@@ -351,7 +351,7 @@ class Issue1305 : public ActionsDemo
public:
virtual void onEnter();
virtual void onExit();
- void log(Node* pSender);
+ void log(Node* sender);
void addSprite(float dt);
virtual std::string title();
virtual std::string subtitle();
@@ -393,7 +393,7 @@ public:
virtual void onEnter();
virtual std::string subtitle();
virtual std::string title();
- void logSprRotation(Sprite* pSender);
+ void logSprRotation(Sprite* sender);
};
class Issue1398 : public ActionsDemo
diff --git a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp
index 32536a540e..6755e7af84 100644
--- a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp
+++ b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp
@@ -48,7 +48,7 @@ bool AppDelegate::applicationDidFinishLaunching()
director->setContentScaleFactor(resourceSize.height/designSize.height);
}
- EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionNoBorder);
+ EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER);
auto scene = Scene::create();
auto layer = new TestController();
diff --git a/samples/Cpp/TestCpp/Classes/BaseTest.cpp b/samples/Cpp/TestCpp/Classes/BaseTest.cpp
index de2ef9a17e..5660d4baaa 100644
--- a/samples/Cpp/TestCpp/Classes/BaseTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/BaseTest.cpp
@@ -64,17 +64,17 @@ std::string BaseTest::subtitle()
return "";
}
-void BaseTest::restartCallback(Object* pSender)
+void BaseTest::restartCallback(Object* sender)
{
log("override restart!");
}
-void BaseTest::nextCallback(Object* pSender)
+void BaseTest::nextCallback(Object* sender)
{
log("override next!");
}
-void BaseTest::backCallback(Object* pSender)
+void BaseTest::backCallback(Object* sender)
{
log("override back!");
}
diff --git a/samples/Cpp/TestCpp/Classes/BaseTest.h b/samples/Cpp/TestCpp/Classes/BaseTest.h
index cf9b5d06b5..d1e77c5a11 100644
--- a/samples/Cpp/TestCpp/Classes/BaseTest.h
+++ b/samples/Cpp/TestCpp/Classes/BaseTest.h
@@ -20,9 +20,9 @@ public:
virtual std::string title();
virtual std::string subtitle();
- virtual void restartCallback(Object* pSender);
- virtual void nextCallback(Object* pSender);
- virtual void backCallback(Object* pSender);
+ virtual void restartCallback(Object* sender);
+ virtual void nextCallback(Object* sender);
+ virtual void backCallback(Object* sender);
};
diff --git a/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp b/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp
index 36913874db..aa75313475 100644
--- a/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp
@@ -141,7 +141,7 @@ void Box2DTestLayer::draw()
Layer::draw();
#if CC_ENABLE_BOX2D_INTEGRATION
- ccGLEnableVertexAttribs( kVertexAttribFlag_Position );
+ ccGLEnableVertexAttribs( VERTEX_ATTRIB_FLAG_POSITION );
kmGLPushMatrix();
@@ -213,7 +213,7 @@ void Box2DTestLayer::ccTouchesEnded(Set* touches, Event* event)
for( it = touches->begin(); it != touches->end(); it++)
{
- touch = (Touch*)(*it);
+ touch = static_cast(*it);
if(!touch)
break;
diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Box2dView.cpp b/samples/Cpp/TestCpp/Classes/Box2DTestBed/Box2dView.cpp
index b07b92d335..aae885e2e4 100644
--- a/samples/Cpp/TestCpp/Classes/Box2DTestBed/Box2dView.cpp
+++ b/samples/Cpp/TestCpp/Classes/Box2DTestBed/Box2dView.cpp
@@ -191,7 +191,7 @@ void Box2DView::draw()
{
Layer::draw();
- ccGLEnableVertexAttribs( kVertexAttribFlag_Position );
+ GL::enableVertexAttribs( cocos2d::GL::VERTEX_ATTRIB_FLAG_POSITION );
kmGLPushMatrix();
diff --git a/samples/Cpp/TestCpp/Classes/Box2DTestBed/GLES-Render.cpp b/samples/Cpp/TestCpp/Classes/Box2DTestBed/GLES-Render.cpp
index 81789e5a35..e6a6e3f7f9 100644
--- a/samples/Cpp/TestCpp/Classes/Box2DTestBed/GLES-Render.cpp
+++ b/samples/Cpp/TestCpp/Classes/Box2DTestBed/GLES-Render.cpp
@@ -40,7 +40,7 @@ GLESDebugDraw::GLESDebugDraw( float32 ratio )
void GLESDebugDraw::initShader( void )
{
- mShaderProgram = ShaderCache::getInstance()->programForKey(kShader_Position_uColor);
+ mShaderProgram = ShaderCache::getInstance()->programForKey(GLProgram::SHADER_NAME_POSITION_U_COLOR);
mColorLocation = glGetUniformLocation( mShaderProgram->getProgram(), "u_color");
}
@@ -59,7 +59,7 @@ void GLESDebugDraw::DrawPolygon(const b2Vec2* old_vertices, int vertexCount, con
mShaderProgram->setUniformLocationWith4f(mColorLocation, color.r, color.g, color.b, 1);
- glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices);
+ glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);
glDrawArrays(GL_LINE_LOOP, 0, vertexCount);
CC_INCREMENT_GL_DRAWS(1);
@@ -82,7 +82,7 @@ void GLESDebugDraw::DrawSolidPolygon(const b2Vec2* old_vertices, int vertexCount
mShaderProgram->setUniformLocationWith4f(mColorLocation, color.r*0.5f, color.g*0.5f, color.b*0.5f, 0.5f);
- glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices);
+ glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);
glDrawArrays(GL_TRIANGLE_FAN, 0, vertexCount);
@@ -116,7 +116,7 @@ void GLESDebugDraw::DrawCircle(const b2Vec2& center, float32 radius, const b2Col
}
mShaderProgram->setUniformLocationWith4f(mColorLocation, color.r, color.g, color.b, 1);
- glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, glVertices);
+ glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, glVertices);
glDrawArrays(GL_LINE_LOOP, 0, vertexCount);
@@ -147,7 +147,7 @@ void GLESDebugDraw::DrawSolidCircle(const b2Vec2& center, float32 radius, const
}
mShaderProgram->setUniformLocationWith4f(mColorLocation, color.r*0.5f, color.g*0.5f, color.b*0.5f, 0.5f);
- glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, glVertices);
+ glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, glVertices);
glDrawArrays(GL_TRIANGLE_FAN, 0, vertexCount);
@@ -176,7 +176,7 @@ void GLESDebugDraw::DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Colo
p1.x * mRatio, p1.y * mRatio,
p2.x * mRatio, p2.y * mRatio
};
- glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, glVertices);
+ glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, glVertices);
glDrawArrays(GL_LINES, 0, 2);
@@ -209,7 +209,7 @@ void GLESDebugDraw::DrawPoint(const b2Vec2& p, float32 size, const b2Color& colo
p.x * mRatio, p.y * mRatio
};
- glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, glVertices);
+ glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, glVertices);
glDrawArrays(GL_POINTS, 0, 1);
// glPointSize(1.0f);
@@ -240,7 +240,7 @@ void GLESDebugDraw::DrawAABB(b2AABB* aabb, const b2Color& color)
aabb->lowerBound.x * mRatio, aabb->upperBound.y * mRatio
};
- glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, glVertices);
+ glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, glVertices);
glDrawArrays(GL_LINE_LOOP, 0, 8);
CC_INCREMENT_GL_DRAWS(1);
diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp
index 2798076821..d14bb1ab45 100644
--- a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp
+++ b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.cpp
@@ -56,7 +56,7 @@ bool Bug1159Layer::init()
return false;
}
-void Bug1159Layer::callBack(Object* pSender)
+void Bug1159Layer::callBack(Object* sender)
{
Director::getInstance()->replaceScene(TransitionPageTurn::create(1.0f, Bug1159Layer::scene(), false));
}
diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.h b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.h
index f01a1885ce..1c7383a952 100644
--- a/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.h
+++ b/samples/Cpp/TestCpp/Classes/BugsTest/Bug-1159.h
@@ -9,7 +9,7 @@ public:
virtual bool init();
virtual void onExit();
static Scene* scene();
- void callBack(Object* pSender);
+ void callBack(Object* sender);
CREATE_FUNC(Bug1159Layer);
};
diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.cpp b/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.cpp
index 392c8f8a74..4c1afe8585 100644
--- a/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.cpp
@@ -70,16 +70,16 @@ void BugsTestMainLayer::onEnter()
setTouchEnabled(true);
}
-void BugsTestMainLayer::ccTouchesBegan(Set *pTouches, Event *pEvent)
+void BugsTestMainLayer::ccTouchesBegan(Set *touches, Event *event)
{
- Touch* touch = (Touch*) pTouches->anyObject();
+ Touch* touch = static_cast( touches->anyObject() );
_beginPos = touch->getLocation();
}
-void BugsTestMainLayer::ccTouchesMoved(Set *pTouches, Event *pEvent)
+void BugsTestMainLayer::ccTouchesMoved(Set *touches, Event *event)
{
- Touch* touch = (Touch*) pTouches->anyObject();
+ Touch* touch = static_cast( touches->anyObject() );
Point touchLocation = touch->getLocation();
float nMoveY = touchLocation.y - _beginPos.y;
@@ -122,7 +122,7 @@ void BugsTestBaseLayer::onEnter()
addChild(menu);
}
-void BugsTestBaseLayer::backCallback(Object* pSender)
+void BugsTestBaseLayer::backCallback(Object* sender)
{
// Director::getInstance()->enableRetinaDisplay(false);
BugsTestScene* scene = new BugsTestScene();
diff --git a/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.h b/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.h
index d212a44180..2ec930f3be 100644
--- a/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.h
+++ b/samples/Cpp/TestCpp/Classes/BugsTest/BugsTest.h
@@ -8,8 +8,8 @@ class BugsTestMainLayer : public Layer
public:
virtual void onEnter();
- virtual void ccTouchesBegan(Set *pTouches, Event *pEvent);
- virtual void ccTouchesMoved(Set *pTouches, Event *pEvent);
+ virtual void ccTouchesBegan(Set *touches, Event *event);
+ virtual void ccTouchesMoved(Set *touches, Event *event);
protected:
Point _beginPos;
@@ -20,7 +20,7 @@ class BugsTestBaseLayer : public Layer
{
public:
virtual void onEnter();
- void backCallback(Object* pSender);
+ void backCallback(Object* sender);
};
class BugsTestScene : public TestScene
diff --git a/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.cpp b/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.cpp
index 7c17ad36b2..a7b450da09 100644
--- a/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.cpp
@@ -70,7 +70,7 @@ ChipmunkTestLayer::ChipmunkTestLayer()
}
-void ChipmunkTestLayer::toggleDebugCallback(Object* pSender)
+void ChipmunkTestLayer::toggleDebugCallback(Object* sender)
{
#if CC_ENABLE_CHIPMUNK_INTEGRATION
_debugLayer->setVisible(! _debugLayer->isVisible());
diff --git a/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h b/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h
index cf64e0017d..7ff01e4daf 100644
--- a/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h
+++ b/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h
@@ -23,7 +23,7 @@ public:
void addNewSpriteAtPosition(Point p);
void update(float dt);
- void toggleDebugCallback(Object* pSender);
+ void toggleDebugCallback(Object* sender);
virtual void ccTouchesEnded(Set* touches, Event* event);
virtual void didAccelerate(Acceleration* pAccelerationValue);
diff --git a/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp b/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp
index c5121c670b..01cef08321 100644
--- a/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp
@@ -37,9 +37,9 @@ MainLayer::MainLayer()
));
}
-void MainLayer::ccTouchesEnded(Set *pTouches, Event *pEvent)
+void MainLayer::ccTouchesEnded(Set *touches, Event *event)
{
- Touch* touch = (Touch*) pTouches->anyObject();
+ Touch* touch = static_cast( touches->anyObject() );
Point location = touch->getLocation();
diff --git a/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.h b/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.h
index 17233755e9..8dae4f5990 100644
--- a/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.h
+++ b/samples/Cpp/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.h
@@ -13,7 +13,7 @@ class MainLayer : public Layer
{
public:
MainLayer();
- virtual void ccTouchesEnded(Set *pTouches, Event *pEvent);
+ virtual void ccTouchesEnded(Set *touches, Event *event);
};
#endif
diff --git a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp
index 211a153627..9f9733ad6e 100644
--- a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.cpp
@@ -529,9 +529,9 @@ void ScrollViewDemo::setup()
this->setTouchEnabled(true);
}
-void ScrollViewDemo::ccTouchesBegan(Set *pTouches, Event *pEvent)
+void ScrollViewDemo::ccTouchesBegan(Set *touches, Event *event)
{
- Touch *touch = (Touch*)pTouches->anyObject();
+ Touch *touch = static_cast(touches->anyObject());
Node *clipper = this->getChildByTag(kTagClipperNode);
Point point = clipper->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView()));
Rect rect = Rect(0, 0, clipper->getContentSize().width, clipper->getContentSize().height);
@@ -539,10 +539,10 @@ void ScrollViewDemo::ccTouchesBegan(Set *pTouches, Event *pEvent)
_lastPoint = point;
}
-void ScrollViewDemo::ccTouchesMoved(Set *pTouches, Event *pEvent)
+void ScrollViewDemo::ccTouchesMoved(Set *touches, Event *event)
{
if (!_scrolling) return;
- Touch *touch = (Touch*)pTouches->anyObject();
+ Touch *touch = static_cast(touches->anyObject());
Node *clipper = this->getChildByTag(kTagClipperNode);
Point point = clipper->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView()));
Point diff = point - _lastPoint;
@@ -551,7 +551,7 @@ void ScrollViewDemo::ccTouchesMoved(Set *pTouches, Event *pEvent)
_lastPoint = point;
}
-void ScrollViewDemo::ccTouchesEnded(Set *pTouches, Event *pEvent)
+void ScrollViewDemo::ccTouchesEnded(Set *touches, Event *event)
{
if (!_scrolling) return;
_scrolling = false;
@@ -627,7 +627,7 @@ void RawStencilBufferTest::draw()
this->setupStencilForClippingOnPlane(i);
CHECK_GL_ERROR_DEBUG();
- ccDrawSolidRect(Point::ZERO, stencilPoint, Color4F(1, 1, 1, 1));
+ DrawPrimitives::drawSolidRect(Point::ZERO, stencilPoint, Color4F(1, 1, 1, 1));
kmGLPushMatrix();
this->transform();
@@ -637,7 +637,7 @@ void RawStencilBufferTest::draw()
this->setupStencilForDrawingOnPlane(i);
CHECK_GL_ERROR_DEBUG();
- ccDrawSolidRect(Point::ZERO, winPoint, _planeColor[i]);
+ DrawPrimitives::drawSolidRect(Point::ZERO, winPoint, _planeColor[i]);
kmGLPushMatrix();
this->transform();
@@ -723,8 +723,8 @@ void RawStencilBufferTest4::setupStencilForClippingOnPlane(GLint plane)
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, _alphaThreshold);
#else
- GLProgram *program = ShaderCache::getInstance()->programForKey(kShader_PositionTextureColorAlphaTest);
- GLint alphaValueLocation = glGetUniformLocation(program->getProgram(), kUniformAlphaTestValue);
+ GLProgram *program = ShaderCache::getInstance()->programForKey(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST);
+ GLint alphaValueLocation = glGetUniformLocation(program->getProgram(), GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE);
program->setUniformLocationWith1f(alphaValueLocation, _alphaThreshold);
_sprite->setShaderProgram(program );
#endif
@@ -756,8 +756,8 @@ void RawStencilBufferTest5::setupStencilForClippingOnPlane(GLint plane)
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, _alphaThreshold);
#else
- GLProgram *program = ShaderCache::getInstance()->programForKey(kShader_PositionTextureColorAlphaTest);
- GLint alphaValueLocation = glGetUniformLocation(program->getProgram(), kUniformAlphaTestValue);
+ GLProgram *program = ShaderCache::getInstance()->programForKey(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST);
+ GLint alphaValueLocation = glGetUniformLocation(program->getProgram(), GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE);
program->setUniformLocationWith1f(alphaValueLocation, _alphaThreshold);
_sprite->setShaderProgram( program );
#endif
@@ -812,7 +812,7 @@ void RawStencilBufferTest6::setupStencilForClippingOnPlane(GLint plane)
glStencilMask(planeMask);
glStencilFunc(GL_NEVER, 0, planeMask);
glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP);
- ccDrawSolidRect(Point::ZERO, Point(Director::getInstance()->getWinSize()), Color4F(1, 1, 1, 1));
+ DrawPrimitives::drawSolidRect(Point::ZERO, Point(Director::getInstance()->getWinSize()), Color4F(1, 1, 1, 1));
glStencilFunc(GL_NEVER, planeMask, planeMask);
glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP);
glDisable(GL_DEPTH_TEST);
@@ -821,8 +821,8 @@ void RawStencilBufferTest6::setupStencilForClippingOnPlane(GLint plane)
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, _alphaThreshold);
#else
- GLProgram *program = ShaderCache::getInstance()->programForKey(kShader_PositionTextureColorAlphaTest);
- GLint alphaValueLocation = glGetUniformLocation(program->getProgram(), kUniformAlphaTestValue);
+ GLProgram *program = ShaderCache::getInstance()->programForKey(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST);
+ GLint alphaValueLocation = glGetUniformLocation(program->getProgram(), GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE);
program->setUniformLocationWith1f(alphaValueLocation, _alphaThreshold);
_sprite->setShaderProgram(program);
#endif
diff --git a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h
index fd149c09b7..ec85a98eba 100644
--- a/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h
+++ b/samples/Cpp/TestCpp/Classes/ClippingNodeTest/ClippingNodeTest.h
@@ -98,7 +98,7 @@ public:
virtual std::string title();
virtual std::string subtitle();
void pokeHoleAtPoint(Point point);
- virtual void ccTouchesBegan(Set *pTouches, Event *pEvent);
+ virtual void ccTouchesBegan(Set *touches, Event *event);
private:
ClippingNode* _outerClipper;
Node* _holes;
@@ -111,9 +111,9 @@ public:
virtual std::string title();
virtual std::string subtitle();
virtual void setup();
- virtual void ccTouchesBegan(Set *pTouches, Event *pEvent);
- virtual void ccTouchesMoved(Set *pTouches, Event *pEvent);
- virtual void ccTouchesEnded(Set *pTouches, Event *pEvent);
+ virtual void ccTouchesBegan(Set *touches, Event *event);
+ virtual void ccTouchesMoved(Set *touches, Event *event);
+ virtual void ccTouchesEnded(Set *touches, Event *event);
private:
bool _scrolling;
Point _lastPoint;
diff --git a/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp b/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp
index 368560f9ab..3aae4594f7 100644
--- a/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp
@@ -79,33 +79,33 @@ private:
return true;
}
- bool touchHits(Touch *pTouch)
+ bool touchHits(Touch *touch)
{
const Rect area(0, 0, _child->getContentSize().width, _child->getContentSize().height);
- return area.containsPoint(_child->convertToNodeSpace(pTouch->getLocation()));
+ return area.containsPoint(_child->convertToNodeSpace(touch->getLocation()));
}
- virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent)
+ virtual bool ccTouchBegan(Touch *touch, Event *event)
{
- CC_UNUSED_PARAM(pEvent);
- const bool hits = touchHits(pTouch);
+ CC_UNUSED_PARAM(event);
+ const bool hits = touchHits(touch);
if (hits)
scaleButtonTo(0.9f);
return hits;
}
- virtual void ccTouchEnded(Touch *pTouch, Event *pEvent)
+ virtual void ccTouchEnded(Touch *touch, Event *event)
{
- CC_UNUSED_PARAM(pEvent);
- const bool hits = touchHits(pTouch);
+ CC_UNUSED_PARAM(event);
+ const bool hits = touchHits(touch);
if (hits && _onTriggered)
_onTriggered();
scaleButtonTo(1);
}
- virtual void ccTouchCancelled(Touch *pTouch, Event *pEvent)
+ virtual void ccTouchCancelled(Touch *touch, Event *event)
{
- CC_UNUSED_PARAM(pEvent);
+ CC_UNUSED_PARAM(event);
scaleButtonTo(1);
}
diff --git a/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.cpp b/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.cpp
index 2767ee1539..064bfa29fb 100644
--- a/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.cpp
@@ -84,7 +84,7 @@ void ConfigurationBase::onExit()
BaseTest::onExit();
}
-void ConfigurationBase::restartCallback(Object* pSender)
+void ConfigurationBase::restartCallback(Object* sender)
{
Scene* s = new ConfigurationTestScene();
s->addChild( restartAction() );
@@ -92,7 +92,7 @@ void ConfigurationBase::restartCallback(Object* pSender)
s->release();
}
-void ConfigurationBase::nextCallback(Object* pSender)
+void ConfigurationBase::nextCallback(Object* sender)
{
Scene* s = new ConfigurationTestScene();
s->addChild( nextAction() );
@@ -100,7 +100,7 @@ void ConfigurationBase::nextCallback(Object* pSender)
s->release();
}
-void ConfigurationBase::backCallback(Object* pSender)
+void ConfigurationBase::backCallback(Object* sender)
{
Scene* s = new ConfigurationTestScene();
s->addChild( backAction() );
diff --git a/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.h b/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.h
index 6e3f4feff5..807719cea0 100644
--- a/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.h
+++ b/samples/Cpp/TestCpp/Classes/ConfigurationTest/ConfigurationTest.h
@@ -27,9 +27,9 @@ public:
virtual std::string title();
virtual std::string subtitle();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
};
class ConfigurationLoadConfig : public ConfigurationBase
diff --git a/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.cpp b/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.cpp
index 985f5061f4..215d7f4e33 100644
--- a/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.cpp
@@ -22,7 +22,7 @@ CurlTest::CurlTest()
// the test code is
// http://curl.haxx.se/mail/lib-2009-12/0071.html
-void CurlTest::ccTouchesEnded(Set *pTouches, Event *pEvent)
+void CurlTest::ccTouchesEnded(Set *touches, Event *event)
{
CURL *curl;
CURLcode res;
diff --git a/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.h b/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.h
index 511abb6526..dfa73adbe6 100644
--- a/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.h
+++ b/samples/Cpp/TestCpp/Classes/CurlTest/CurlTest.h
@@ -10,7 +10,7 @@ public:
CurlTest();
~CurlTest();
- virtual void ccTouchesEnded(cocos2d::Set *pTouches, cocos2d::Event *pEvent);
+ virtual void ccTouchesEnded(cocos2d::Set *touches, cocos2d::Event *event);
private:
cocos2d::LabelTTF* _label;
diff --git a/samples/Cpp/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp b/samples/Cpp/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp
index 4fca603e08..6cb43bfb67 100644
--- a/samples/Cpp/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp
@@ -9,49 +9,49 @@ CurrentLanguageTest::CurrentLanguageTest()
LabelTTF *labelLanguage = LabelTTF::create("", "Arial", 20);
labelLanguage->setPosition(VisibleRect::center());
- ccLanguageType currentLanguageType = Application::getInstance()->getCurrentLanguage();
+ LanguageType currentLanguageType = Application::getInstance()->getCurrentLanguage();
switch (currentLanguageType)
{
- case kLanguageEnglish:
+ case LanguageType::ENGLISH:
labelLanguage->setString("current language is English");
break;
- case kLanguageChinese:
+ case LanguageType::CHINESE:
labelLanguage->setString("current language is Chinese");
break;
- case kLanguageFrench:
+ case LanguageType::FRENCH:
labelLanguage->setString("current language is French");
break;
- case kLanguageGerman:
+ case LanguageType::GERMAN:
labelLanguage->setString("current language is German");
break;
- case kLanguageItalian:
+ case LanguageType::ITALIAN:
labelLanguage->setString("current language is Italian");
break;
- case kLanguageRussian:
+ case LanguageType::RUSSIAN:
labelLanguage->setString("current language is Russian");
break;
- case kLanguageSpanish:
+ case LanguageType::SPANISH:
labelLanguage->setString("current language is Spanish");
break;
- case kLanguageKorean:
+ case LanguageType::KOREAN:
labelLanguage->setString("current language is Korean");
break;
- case kLanguageJapanese:
+ case LanguageType::JAPANESE:
labelLanguage->setString("current language is Japanese");
break;
- case kLanguageHungarian:
+ case LanguageType::HUNGARIAN:
labelLanguage->setString("current language is Hungarian");
break;
- case kLanguagePortuguese:
+ case LanguageType::PORTUGUESE:
labelLanguage->setString("current language is Portuguese");
break;
- case kLanguageArabic:
+ case LanguageType::ARABIC:
labelLanguage->setString("current language is Arabic");
break;
- case kLanguageNorwegian:
+ case LanguageType::NORWEGIAN:
labelLanguage->setString("current language is Norwegian");
break;
- case kLanguagePolish:
+ case LanguageType::POLISH:
labelLanguage->setString("current language is Polish");
break;
}
diff --git a/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp b/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp
index db3b1f9d91..114ed7090d 100644
--- a/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp
@@ -123,7 +123,7 @@ void DrawPrimitivesTest::draw()
// color: 255,255,255,255 (white, non-transparent)
// Anti-Aliased
// glEnable(GL_LINE_SMOOTH);
- ccDrawLine( VisibleRect::leftBottom(), VisibleRect::rightTop() );
+ DrawPrimitives::drawLine( VisibleRect::leftBottom(), VisibleRect::rightTop() );
CHECK_GL_ERROR_DEBUG();
@@ -132,8 +132,8 @@ void DrawPrimitivesTest::draw()
// GL_SMOOTH_LINE_WIDTH_RANGE = (1,1) on iPhone
// glDisable(GL_LINE_SMOOTH);
glLineWidth( 5.0f );
- ccDrawColor4B(255,0,0,255);
- ccDrawLine( VisibleRect::leftTop(), VisibleRect::rightBottom() );
+ DrawPrimitives::setDrawColor4B(255,0,0,255);
+ DrawPrimitives::drawLine( VisibleRect::leftTop(), VisibleRect::rightBottom() );
CHECK_GL_ERROR_DEBUG();
@@ -144,81 +144,81 @@ void DrawPrimitivesTest::draw()
// Remember: OpenGL is a state-machine.
// draw big point in the center
- ccPointSize(64);
- ccDrawColor4B(0,0,255,128);
- ccDrawPoint( VisibleRect::center() );
+ DrawPrimitives::setPointSize(64);
+ DrawPrimitives::setDrawColor4B(0,0,255,128);
+ DrawPrimitives::drawPoint( VisibleRect::center() );
CHECK_GL_ERROR_DEBUG();
// draw 4 small points
Point points[] = { Point(60,60), Point(70,70), Point(60,70), Point(70,60) };
- ccPointSize(4);
- ccDrawColor4B(0,255,255,255);
- ccDrawPoints( points, 4);
+ DrawPrimitives::setPointSize(4);
+ DrawPrimitives::setDrawColor4B(0,255,255,255);
+ DrawPrimitives::drawPoints( points, 4);
CHECK_GL_ERROR_DEBUG();
// draw a green circle with 10 segments
glLineWidth(16);
- ccDrawColor4B(0, 255, 0, 255);
- ccDrawCircle( VisibleRect::center(), 100, 0, 10, false);
+ DrawPrimitives::setDrawColor4B(0, 255, 0, 255);
+ DrawPrimitives::drawCircle( VisibleRect::center(), 100, 0, 10, false);
CHECK_GL_ERROR_DEBUG();
// draw a green circle with 50 segments with line to center
glLineWidth(2);
- ccDrawColor4B(0, 255, 255, 255);
- ccDrawCircle( VisibleRect::center(), 50, CC_DEGREES_TO_RADIANS(90), 50, true);
+ DrawPrimitives::setDrawColor4B(0, 255, 255, 255);
+ DrawPrimitives::drawCircle( VisibleRect::center(), 50, CC_DEGREES_TO_RADIANS(90), 50, true);
CHECK_GL_ERROR_DEBUG();
// draw a pink solid circle with 50 segments
glLineWidth(2);
- ccDrawColor4B(255, 0, 255, 255);
- ccDrawSolidCircle( VisibleRect::center() + Point(140,0), 40, CC_DEGREES_TO_RADIANS(90), 50, 1.0f, 1.0f);
+ DrawPrimitives::setDrawColor4B(255, 0, 255, 255);
+ DrawPrimitives::drawSolidCircle( VisibleRect::center() + Point(140,0), 40, CC_DEGREES_TO_RADIANS(90), 50, 1.0f, 1.0f);
CHECK_GL_ERROR_DEBUG();
// open yellow poly
- ccDrawColor4B(255, 255, 0, 255);
+ DrawPrimitives::setDrawColor4B(255, 255, 0, 255);
glLineWidth(10);
Point vertices[] = { Point(0,0), Point(50,50), Point(100,50), Point(100,100), Point(50,100) };
- ccDrawPoly( vertices, 5, false);
+ DrawPrimitives::drawPoly( vertices, 5, false);
CHECK_GL_ERROR_DEBUG();
// filled poly
glLineWidth(1);
Point filledVertices[] = { Point(0,120), Point(50,120), Point(50,170), Point(25,200), Point(0,170) };
- ccDrawSolidPoly(filledVertices, 5, Color4F(0.5f, 0.5f, 1, 1 ) );
+ DrawPrimitives::drawSolidPoly(filledVertices, 5, Color4F(0.5f, 0.5f, 1, 1 ) );
// closed purble poly
- ccDrawColor4B(255, 0, 255, 255);
+ DrawPrimitives::setDrawColor4B(255, 0, 255, 255);
glLineWidth(2);
Point vertices2[] = { Point(30,130), Point(30,230), Point(50,200) };
- ccDrawPoly( vertices2, 3, true);
+ DrawPrimitives::drawPoly( vertices2, 3, true);
CHECK_GL_ERROR_DEBUG();
// draw quad bezier path
- ccDrawQuadBezier(VisibleRect::leftTop(), VisibleRect::center(), VisibleRect::rightTop(), 50);
+ DrawPrimitives::drawQuadBezier(VisibleRect::leftTop(), VisibleRect::center(), VisibleRect::rightTop(), 50);
CHECK_GL_ERROR_DEBUG();
// draw cubic bezier path
- ccDrawCubicBezier(VisibleRect::center(), Point(VisibleRect::center().x+30,VisibleRect::center().y+50), Point(VisibleRect::center().x+60,VisibleRect::center().y-50),VisibleRect::right(),100);
+ DrawPrimitives::drawCubicBezier(VisibleRect::center(), Point(VisibleRect::center().x+30,VisibleRect::center().y+50), Point(VisibleRect::center().x+60,VisibleRect::center().y-50),VisibleRect::right(),100);
CHECK_GL_ERROR_DEBUG();
//draw a solid polygon
Point vertices3[] = {Point(60,160), Point(70,190), Point(100,190), Point(90,160)};
- ccDrawSolidPoly( vertices3, 4, Color4F(1,1,0,1) );
+ DrawPrimitives::drawSolidPoly( vertices3, 4, Color4F(1,1,0,1) );
// restore original values
glLineWidth(1);
- ccDrawColor4B(255,255,255,255);
- ccPointSize(1);
+ DrawPrimitives::setDrawColor4B(255,255,255,255);
+ DrawPrimitives::setPointSize(1);
CHECK_GL_ERROR_DEBUG();
}
diff --git a/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h b/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h
index 9f7bbba77a..8b24b3c00a 100644
--- a/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h
+++ b/samples/Cpp/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h
@@ -12,9 +12,9 @@ class BaseLayer : public BaseTest
public:
BaseLayer();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
virtual std::string title();
virtual std::string subtitle();
virtual void onEnter();
diff --git a/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp b/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp
index 99f8b79691..910033e094 100644
--- a/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp
@@ -215,7 +215,7 @@ void Effect5::onExit()
{
EffectAdvanceTextLayer::onExit();
- Director::getInstance()->setProjection(kDirectorProjection3D);
+ Director::getInstance()->setProjection(Director::Projection::_3D);
}
//------------------------------------------------------------------
@@ -368,7 +368,7 @@ std::string EffectAdvanceTextLayer::subtitle()
return "";
}
-void EffectAdvanceTextLayer::restartCallback(Object* pSender)
+void EffectAdvanceTextLayer::restartCallback(Object* sender)
{
Scene* s = new EffectAdvanceScene();
s->addChild(restartEffectAdvanceAction());
@@ -377,7 +377,7 @@ void EffectAdvanceTextLayer::restartCallback(Object* pSender)
s->release();
}
-void EffectAdvanceTextLayer::nextCallback(Object* pSender)
+void EffectAdvanceTextLayer::nextCallback(Object* sender)
{
Scene* s = new EffectAdvanceScene();
s->addChild( nextEffectAdvanceAction() );
@@ -386,7 +386,7 @@ void EffectAdvanceTextLayer::nextCallback(Object* pSender)
s->release();
}
-void EffectAdvanceTextLayer::backCallback(Object* pSender)
+void EffectAdvanceTextLayer::backCallback(Object* sender)
{
Scene* s = new EffectAdvanceScene();
s->addChild( backEffectAdvanceAction() );
diff --git a/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h b/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h
index c041520641..b64d48dc9e 100644
--- a/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h
+++ b/samples/Cpp/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.h
@@ -19,9 +19,9 @@ public:
virtual std::string title();
virtual std::string subtitle();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
};
class Effect1 : public EffectAdvanceTextLayer
diff --git a/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.cpp b/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.cpp
index b26620e1a8..9603c0a0ae 100644
--- a/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.cpp
@@ -408,12 +408,12 @@ void TextLayer::newScene()
s->release();
}
-void TextLayer::restartCallback(Object* pSender)
+void TextLayer::restartCallback(Object* sender)
{
newScene();
}
-void TextLayer::nextCallback(Object* pSender)
+void TextLayer::nextCallback(Object* sender)
{
// update the action index
actionIdx++;
@@ -422,7 +422,7 @@ void TextLayer::nextCallback(Object* pSender)
newScene();
}
-void TextLayer::backCallback(Object* pSender)
+void TextLayer::backCallback(Object* sender)
{
// update the action index
actionIdx--;
diff --git a/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.h b/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.h
index 068cfc8afe..2f65c73711 100644
--- a/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.h
+++ b/samples/Cpp/TestCpp/Classes/EffectsTest/EffectsTest.h
@@ -23,9 +23,9 @@ public:
virtual void onEnter();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
void newScene();
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp
index 6d722b6ce8..6ca1144601 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp
@@ -110,7 +110,7 @@ void ArmatureTestScene::runThisTest()
Director::getInstance()->replaceScene(this);
}
-void ArmatureTestScene::MainMenuCallback(Object* pSender)
+void ArmatureTestScene::MainMenuCallback(Object* sender)
{
removeAllChildren();
ArmatureDataManager::sharedArmatureDataManager()->purgeArmatureSystem();
@@ -154,7 +154,7 @@ void ArmatureTestLayer::onEnter()
addChild(menu, 100);
- setShaderProgram(ShaderCache::getInstance()->programForKey(kShader_PositionTextureColor));
+ setShaderProgram(ShaderCache::getInstance()->programForKey(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
}
void ArmatureTestLayer::onExit()
@@ -170,21 +170,21 @@ std::string ArmatureTestLayer::subtitle()
return "";
}
-void ArmatureTestLayer::restartCallback(Object* pSender)
+void ArmatureTestLayer::restartCallback(Object* sender)
{
Scene* s = new ArmatureTestScene();
s->addChild( RestartTest() );
Director::getInstance()->replaceScene(s);
s->release();
}
-void ArmatureTestLayer::nextCallback(Object* pSender)
+void ArmatureTestLayer::nextCallback(Object* sender)
{
Scene* s = new ArmatureTestScene();
s->addChild( NextTest() );
Director::getInstance()->replaceScene(s);
s->release();
}
-void ArmatureTestLayer::backCallback(Object* pSender)
+void ArmatureTestLayer::backCallback(Object* sender)
{
Scene* s = new ArmatureTestScene();
s->addChild( BackTest() );
@@ -450,7 +450,7 @@ std::string TestParticleDisplay::subtitle()
{
return "Touch to change animation";
}
-bool TestParticleDisplay::ccTouchBegan(Touch *pTouch, Event *pEvent)
+bool TestParticleDisplay::ccTouchBegan(Touch *touch, Event *event)
{
++animationID;
animationID = animationID % armature->getAnimation()->getMovementCount();
@@ -496,7 +496,7 @@ std::string TestUseMutiplePicture::subtitle()
{
return "weapon and armature are in different picture";
}
-bool TestUseMutiplePicture::ccTouchBegan(Touch *pTouch, Event *pEvent)
+bool TestUseMutiplePicture::ccTouchBegan(Touch *touch, Event *event)
{
++displayIndex;
displayIndex = (displayIndex) % 6;
@@ -539,7 +539,7 @@ std::string TestBox2DDetector::title()
}
void TestBox2DDetector::draw()
{
- ccGLEnableVertexAttribs( kVertexAttribFlag_Position );
+ GL::enableVertexAttribs( cocos2d::GL::VERTEX_ATTRIB_FLAG_POSITION );
kmGLPushMatrix();
@@ -581,8 +581,8 @@ void TestBoundingBox::draw()
rect = RectApplyAffineTransform(armature->getBoundingBox(), armature->getNodeToParentTransform());
- ccDrawColor4B(100, 100, 100, 255);
- ccDrawRect(rect.origin, Point(rect.getMaxX(), rect.getMaxY()));
+ DrawPrimitives::setDrawColor4B(100, 100, 100, 255);
+ DrawPrimitives::drawRect(rect.origin, Point(rect.getMaxX(), rect.getMaxY()));
}
@@ -631,7 +631,7 @@ std::string TestArmatureNesting::title()
{
return "Test Armature Nesting";
}
-bool TestArmatureNesting::ccTouchBegan(Touch *pTouch, Event *pEvent)
+bool TestArmatureNesting::ccTouchBegan(Touch *touch, Event *event)
{
++weaponIndex;
weaponIndex = weaponIndex % 4;
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.h
index 454f079ffd..8115958e0f 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.h
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.h
@@ -31,7 +31,7 @@ public:
virtual void runThisTest();
// The CallBack for back to the main menu scene
- virtual void MainMenuCallback(Object* pSender);
+ virtual void MainMenuCallback(Object* sender);
};
enum {
@@ -60,9 +60,9 @@ public:
virtual std::string title();
virtual std::string subtitle();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
virtual void draw();
};
@@ -139,7 +139,7 @@ class TestUseMutiplePicture : public ArmatureTestLayer
virtual void onEnter();
virtual std::string title();
virtual std::string subtitle();
- virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent);
+ virtual bool ccTouchBegan(Touch *touch, Event *event);
virtual void registerWithTouchDispatcher();
int displayIndex;
@@ -151,7 +151,7 @@ class TestParticleDisplay : public ArmatureTestLayer
virtual void onEnter();
virtual std::string title();
virtual std::string subtitle();
- virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent);
+ virtual bool ccTouchBegan(Touch *touch, Event *event);
virtual void registerWithTouchDispatcher();
int animationID;
@@ -195,7 +195,7 @@ class TestArmatureNesting : public ArmatureTestLayer
public:
virtual void onEnter();
virtual std::string title();
- virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent);
+ virtual bool ccTouchBegan(Touch *touch, Event *event);
virtual void registerWithTouchDispatcher();
cocos2d::extension::armature::Armature *armature;
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp
index aefc75f099..a57d3020ee 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp
@@ -12,12 +12,12 @@ AnimationsTestLayer::~AnimationsTestLayer()
CC_SAFE_RELEASE_NULL(mAnimationManager);
}
-SEL_MenuHandler AnimationsTestLayer::onResolveCCBMenuItemSelector(Object * pTarget, const char * pSelectorName)
+SEL_MenuHandler AnimationsTestLayer::onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName)
{
return NULL;
}
-SEL_CCControlHandler AnimationsTestLayer::onResolveCCBControlSelector(Object *pTarget, const char*pSelectorName) {
+SEL_CCControlHandler AnimationsTestLayer::onResolveCCBCCControlSelector(Object *pTarget, const char*pSelectorName) {
CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onControlButtonIdleClicked", AnimationsTestLayer::onControlButtonIdleClicked);
CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onControlButtonWaveClicked", AnimationsTestLayer::onControlButtonWaveClicked);
CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onControlButtonJumpClicked", AnimationsTestLayer::onControlButtonJumpClicked);
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h
index b92d1192fb..d72757d3ce 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h
@@ -15,14 +15,14 @@ public:
AnimationsTestLayer();
virtual ~AnimationsTestLayer();
- virtual cocos2d::SEL_MenuHandler onResolveCCBMenuItemSelector(Object * pTarget, const char * pSelectorName);
- virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBControlSelector(cocos2d::Object * pTarget, const char * pSelectorName);
+ virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName);
+ virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName);
virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * node);
- void onControlButtonIdleClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent);
- void onControlButtonWaveClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent);
- void onControlButtonJumpClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent);
- void onControlButtonFunkyClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent);
+ void onControlButtonIdleClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent);
+ void onControlButtonWaveClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent);
+ void onControlButtonJumpClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent);
+ void onControlButtonFunkyClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent);
void setAnimationManager(cocos2d::extension::CCBAnimationManager *pAnimationManager);
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp
index 0b3924e655..ca907cb4ca 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp
@@ -12,11 +12,11 @@ ButtonTestLayer::~ButtonTestLayer()
CC_SAFE_RELEASE(mControlEventLabel);
}
-SEL_MenuHandler ButtonTestLayer::onResolveCCBMenuItemSelector(Object * pTarget, const char * pSelectorName) {
+SEL_MenuHandler ButtonTestLayer::onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName) {
return NULL;
}
-SEL_CCControlHandler ButtonTestLayer::onResolveCCBControlSelector(Object * pTarget, const char * pSelectorName) {
+SEL_CCControlHandler ButtonTestLayer::onResolveCCBCCControlSelector(Object * pTarget, const char * pSelectorName) {
CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onControlButtonClicked", ButtonTestLayer::onControlButtonClicked);
return NULL;
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h
index a8d9c06c86..f79a54576b 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h
@@ -15,11 +15,11 @@ public:
ButtonTestLayer();
virtual ~ButtonTestLayer();
- virtual cocos2d::SEL_MenuHandler onResolveCCBMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName);
- virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBControlSelector(cocos2d::Object * pTarget, const char * pSelectorName);
+ virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName);
+ virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName);
virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * node);
- void onControlButtonClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent);
+ void onControlButtonClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent);
private:
cocos2d::LabelBMFont * mControlEventLabel;
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp
index 1458d1b5d2..8942ac199c 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp
@@ -68,11 +68,11 @@ void HelloCocosBuilderLayer::onNodeLoaded(cocos2d::Node * node, cocos2d::extens
}
-SEL_MenuHandler HelloCocosBuilderLayer::onResolveCCBMenuItemSelector(Object * pTarget, const char * pSelectorName) {
+SEL_MenuHandler HelloCocosBuilderLayer::onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName) {
return NULL;
}
-SEL_CCControlHandler HelloCocosBuilderLayer::onResolveCCBControlSelector(Object * pTarget, const char * pSelectorName) {
+SEL_CCControlHandler HelloCocosBuilderLayer::onResolveCCBCCControlSelector(Object * pTarget, const char * pSelectorName) {
CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onMenuTestClicked", HelloCocosBuilderLayer::onMenuTestClicked);
CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onSpriteTestClicked", HelloCocosBuilderLayer::onSpriteTestClicked);
CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onButtonTestClicked", HelloCocosBuilderLayer::onButtonTestClicked);
@@ -126,19 +126,19 @@ bool HelloCocosBuilderLayer::onAssignCCBCustomProperty(Object* pTarget, const ch
return bRet;
}
-void HelloCocosBuilderLayer::onMenuTestClicked(Object * pSender, cocos2d::extension::ControlEvent pControlEvent) {
+void HelloCocosBuilderLayer::onMenuTestClicked(Object * sender, cocos2d::extension::ControlEvent pControlEvent) {
this->openTest("ccb/ccb/TestMenus.ccbi", "TestMenusLayer", MenuTestLayerLoader::loader());
}
-void HelloCocosBuilderLayer::onSpriteTestClicked(Object * pSender, cocos2d::extension::ControlEvent pControlEvent) {
+void HelloCocosBuilderLayer::onSpriteTestClicked(Object * sender, cocos2d::extension::ControlEvent pControlEvent) {
this->openTest("ccb/ccb/TestSprites.ccbi", "TestSpritesLayer", SpriteTestLayerLoader::loader());
}
-void HelloCocosBuilderLayer::onButtonTestClicked(Object * pSender, cocos2d::extension::ControlEvent pControlEvent) {
+void HelloCocosBuilderLayer::onButtonTestClicked(Object * sender, cocos2d::extension::ControlEvent pControlEvent) {
this->openTest("ccb/ccb/TestButtons.ccbi", "TestButtonsLayer", ButtonTestLayerLoader::loader());
}
-void HelloCocosBuilderLayer::onAnimationsTestClicked(Object * pSender, cocos2d::extension::ControlEvent pControlEvent) {
+void HelloCocosBuilderLayer::onAnimationsTestClicked(Object * sender, cocos2d::extension::ControlEvent pControlEvent) {
/* Create an autorelease NodeLoaderLibrary. */
NodeLoaderLibrary * ccNodeLoaderLibrary = NodeLoaderLibrary::newDefaultNodeLoaderLibrary();
@@ -179,16 +179,16 @@ void HelloCocosBuilderLayer::onAnimationsTestClicked(Object * pSender, cocos2d::
//this->openTest("TestAnimations.ccbi", "TestAnimationsLayer", AnimationsTestLayerLoader::loader());
}
-void HelloCocosBuilderLayer::onParticleSystemTestClicked(Object * pSender, cocos2d::extension::ControlEvent pControlEvent) {
+void HelloCocosBuilderLayer::onParticleSystemTestClicked(Object * sender, cocos2d::extension::ControlEvent pControlEvent) {
this->openTest("ccb/ccb/TestParticleSystems.ccbi", "TestParticleSystemsLayer", ParticleSystemTestLayerLoader::loader());
}
-void HelloCocosBuilderLayer::onScrollViewTestClicked(Object * pSender, cocos2d::extension::ControlEvent pControlEvent)
+void HelloCocosBuilderLayer::onScrollViewTestClicked(Object * sender, cocos2d::extension::ControlEvent pControlEvent)
{
this->openTest("ccb/ccb/TestScrollViews.ccbi", "TestScrollViewsLayer", ScrollViewTestLayerLoader::loader());
}
-void HelloCocosBuilderLayer::onTimelineCallbackSoundClicked(Object * pSender, cocos2d::extension::ControlEvent pControlEvent)
+void HelloCocosBuilderLayer::onTimelineCallbackSoundClicked(Object * sender, cocos2d::extension::ControlEvent pControlEvent)
{
this->openTest("ccb/ccb/TestTimelineCallback.ccbi", "TimelineCallbackTestLayer", TimelineCallbackTestLayerLoader::loader());
}
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h
index 267a9adad8..9a8cabf042 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h
@@ -28,19 +28,19 @@ class HelloCocosBuilderLayer
void openTest(const char * pCCBFileName, const char * nodeName = NULL, cocos2d::extension::NodeLoader * nodeLoader = NULL);
- virtual cocos2d::SEL_MenuHandler onResolveCCBMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName);
- virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBControlSelector(cocos2d::Object * pTarget, const char * pSelectorName);
+ virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName);
+ virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName);
virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * node);
virtual bool onAssignCCBCustomProperty(Object* pTarget, const char* pMemberVariableName, cocos2d::extension::CCBValue* pCCBValue);
virtual void onNodeLoaded(cocos2d::Node * node, cocos2d::extension::NodeLoader * nodeLoader);
- void onMenuTestClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent);
- void onSpriteTestClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent);
- void onButtonTestClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent);
- void onAnimationsTestClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent);
- void onParticleSystemTestClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent);
- void onScrollViewTestClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent);
- void onTimelineCallbackSoundClicked(cocos2d::Object * pSender, cocos2d::extension::ControlEvent pControlEvent);
+ void onMenuTestClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent);
+ void onSpriteTestClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent);
+ void onButtonTestClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent);
+ void onAnimationsTestClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent);
+ void onParticleSystemTestClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent);
+ void onScrollViewTestClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent);
+ void onTimelineCallbackSoundClicked(cocos2d::Object * sender, cocos2d::extension::ControlEvent pControlEvent);
private:
cocos2d::Sprite * mBurstSprite;
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp
index 3d42048cf0..36bcf964e9 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp
@@ -12,7 +12,7 @@ MenuTestLayer::~MenuTestLayer()
CC_SAFE_RELEASE(mMenuItemStatusLabelBMFont);
}
-SEL_MenuHandler MenuTestLayer::onResolveCCBMenuItemSelector(Object * pTarget, const char * pSelectorName) {
+SEL_MenuHandler MenuTestLayer::onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName) {
CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(this, "onMenuItemAClicked", MenuTestLayer::onMenuItemAClicked);
CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(this, "onMenuItemBClicked", MenuTestLayer::onMenuItemBClicked);
CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(this, "onMenuItemCClicked", MenuTestLayer::onMenuItemCClicked);
@@ -20,7 +20,7 @@ SEL_MenuHandler MenuTestLayer::onResolveCCBMenuItemSelector(Object * pTarget, co
return NULL;
}
-SEL_CCControlHandler MenuTestLayer::onResolveCCBControlSelector(Object * pTarget, const char * pSelectorName) {
+SEL_CCControlHandler MenuTestLayer::onResolveCCBCCControlSelector(Object * pTarget, const char * pSelectorName) {
return NULL;
}
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h
index 95f3994f59..8533e38dda 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h
@@ -15,13 +15,13 @@ class MenuTestLayer
MenuTestLayer();
virtual ~MenuTestLayer();
- virtual cocos2d::SEL_MenuHandler onResolveCCBMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName);
- virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBControlSelector(cocos2d::Object * pTarget, const char * pSelectorName);
+ virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName);
+ virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName);
virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * node);
- void onMenuItemAClicked(cocos2d::Object * pSender);
- void onMenuItemBClicked(cocos2d::Object * pSender);
- void onMenuItemCClicked(cocos2d::Object * pSender);
+ void onMenuItemAClicked(cocos2d::Object * sender);
+ void onMenuItemBClicked(cocos2d::Object * sender);
+ void onMenuItemCClicked(cocos2d::Object * sender);
private:
cocos2d::LabelBMFont * mMenuItemStatusLabelBMFont;
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp
index 7de128ab96..6129a5faa8 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp
@@ -3,13 +3,13 @@
USING_NS_CC;
USING_NS_CC_EXT;
-SEL_MenuHandler TestHeaderLayer::onResolveCCBMenuItemSelector(Object * pTarget, const char * pSelectorName) {
+SEL_MenuHandler TestHeaderLayer::onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName) {
CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(this, "onBackClicked", TestHeaderLayer::onBackClicked);
return NULL;
}
-SEL_CCControlHandler TestHeaderLayer::onResolveCCBControlSelector(Object * pTarget, const char * pSelectorName) {
+SEL_CCControlHandler TestHeaderLayer::onResolveCCBCCControlSelector(Object * pTarget, const char * pSelectorName) {
return NULL;
}
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h
index 40a020bc6e..3a8f2dc84d 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h
@@ -12,11 +12,11 @@ class TestHeaderLayer
public:
CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(TestHeaderLayer, create);
- virtual cocos2d::SEL_MenuHandler onResolveCCBMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName);
- virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBControlSelector(cocos2d::Object * pTarget, const char * pSelectorName);
+ virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName);
+ virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName);
virtual void onNodeLoaded(cocos2d::Node * node, cocos2d::extension::NodeLoader * nodeLoader);
- void onBackClicked(cocos2d::Object * pSender);
+ void onBackClicked(cocos2d::Object * sender);
};
#endif
\ No newline at end of file
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp
index 37ed182c6e..fecb8219da 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp
@@ -14,11 +14,11 @@ TimelineCallbackTestLayer::~TimelineCallbackTestLayer()
CocosDenshion::SimpleAudioEngine::end();
}
-SEL_MenuHandler TimelineCallbackTestLayer::onResolveCCBMenuItemSelector(Object * pTarget, const char * pSelectorName) {
+SEL_MenuHandler TimelineCallbackTestLayer::onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName) {
return NULL;
}
-SEL_CCControlHandler TimelineCallbackTestLayer::onResolveCCBControlSelector(Object * pTarget, const char * pSelectorName) {
+SEL_CCControlHandler TimelineCallbackTestLayer::onResolveCCBCCControlSelector(Object * pTarget, const char * pSelectorName) {
return NULL;
}
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h
index d9b045fb16..37059f41f9 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h
@@ -15,8 +15,8 @@ class TimelineCallbackTestLayer
TimelineCallbackTestLayer();
virtual ~TimelineCallbackTestLayer();
- virtual cocos2d::SEL_MenuHandler onResolveCCBMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName);
- virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBControlSelector(cocos2d::Object * pTarget, const char * pSelectorName);
+ virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName);
+ virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName);
virtual cocos2d::SEL_CallFuncN onResolveCCBCallFuncSelector(Object * pTarget, const char* pSelectorName);
virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * node);
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/EnemyController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/EnemyController.cpp
index 8b3ba010ff..2c62142516 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/EnemyController.cpp
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/EnemyController.cpp
@@ -35,17 +35,18 @@ void EnemyController::onEnter()
// Determine speed of the target
- int minDuration = (int)2.0;
- int maxDuration = (int)4.0;
+ int minDuration = 2;
+ int maxDuration = 4;
int rangeDuration = maxDuration - minDuration;
// srand( TimGetTicks() );
int actualDuration = ( rand() % rangeDuration ) + minDuration;
// Create the actions
- FiniteTimeAction* actionMove = MoveTo::create( (float)actualDuration,
+ FiniteTimeAction* actionMove = MoveTo::create( actualDuration,
Point(0 - getOwner()->getContentSize().width/2, actualY) );
- FiniteTimeAction* actionMoveDone = CallFuncN::create(getOwner()->getParent()->getComponent("SceneController"),
- callfuncN_selector(SceneController::spriteMoveFinished));
+ FiniteTimeAction* actionMoveDone = CallFuncN::create(
+ CC_CALLBACK_1(SceneController::spriteMoveFinished, static_cast( getOwner()->getParent()->getComponent("SceneController") )));
+
_owner->runAction( Sequence::create(actionMove, actionMoveDone, NULL) );
}
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.cpp
index 01042b3d99..2b451647e7 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.cpp
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.cpp
@@ -35,10 +35,10 @@ void PlayerController::update(float delta)
}
-void PlayerController::ccTouchesEnded(Set *pTouches, Event *pEvent)
+void PlayerController::ccTouchesEnded(Set *touches, Event *event)
{
// Choose one of the touches to work with
- Touch* touch = (Touch*)( pTouches->anyObject() );
+ Touch* touch = static_cast( touches->anyObject() );
Point location = touch->getLocation();
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.h
index c23e8fa751..61ec49dc4e 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.h
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/PlayerController.h
@@ -12,7 +12,7 @@ protected:
virtual ~PlayerController(void);
public:
- virtual void ccTouchesEnded(cocos2d::Set *pTouches, cocos2d::Event *pEvent);
+ virtual void ccTouchesEnded(cocos2d::Set *touches, cocos2d::Event *event);
public:
virtual bool init();
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/ProjectileController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/ProjectileController.cpp
index 3a3995f430..61fe94b312 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/ProjectileController.cpp
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ComponentsTest/ProjectileController.cpp
@@ -93,6 +93,10 @@ ProjectileController* ProjectileController::create(void)
return pRet;
}
+void freeFunction( Node *ignore )
+{
+ log("hello");
+}
void ProjectileController::move(float flocationX, float flocationY)
{
@@ -121,19 +125,25 @@ void ProjectileController::move(float flocationX, float flocationY)
float velocity = 480/1; // 480pixels/1sec
float realMoveDuration = length/velocity;
- // Move projectile to actual endpoint
- _owner->runAction( Sequence::create(
- MoveTo::create(realMoveDuration, realDest),
- CallFuncN::create(getOwner()->getParent()->getComponent("SceneController"),
- callfuncN_selector(SceneController::spriteMoveFinished)),
- NULL) );
+ auto callfunc = CallFuncN::create(
+ CC_CALLBACK_1(
+ SceneController::spriteMoveFinished,
+ static_cast( getOwner()->getParent()->getComponent("SceneController")
+ ) ) );
+ // Move projectile to actual endpoint
+ _owner->runAction(
+ Sequence::create(
+ MoveTo::create(realMoveDuration, realDest),
+ callfunc,
+ NULL)
+ );
}
void ProjectileController::die()
{
Component *com = _owner->getParent()->getComponent("SceneController");
- cocos2d::Array *_projectiles = ((SceneController*)com)->getProjectiles();
+ cocos2d::Array *_projectiles = static_cast(com)->getProjectiles();
_projectiles->removeObject(_owner);
_owner->removeFromParentAndCleanup(true);
}
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp
index ba96f3d391..514b672c27 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp
@@ -111,16 +111,16 @@ void ExtensionsMainLayer::onEnter()
addChild(_itemMenu);
}
-void ExtensionsMainLayer::ccTouchesBegan(Set *pTouches, Event *pEvent)
+void ExtensionsMainLayer::ccTouchesBegan(Set *touches, Event *event)
{
- Touch* touch = static_cast(pTouches->anyObject());
+ Touch* touch = static_cast(touches->anyObject());
_beginPos = touch->getLocation();
}
-void ExtensionsMainLayer::ccTouchesMoved(Set *pTouches, Event *pEvent)
+void ExtensionsMainLayer::ccTouchesMoved(Set *touches, Event *event)
{
- Touch* touch = static_cast(pTouches->anyObject());
+ Touch* touch = static_cast(touches->anyObject());
Point touchLocation = touch->getLocation();
float nMoveY = touchLocation.y - _beginPos.y;
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.h
index 3b1a77a13d..67b0fb374b 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.h
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.h
@@ -8,8 +8,8 @@ class ExtensionsMainLayer : public Layer
public:
virtual void onEnter();
- virtual void ccTouchesBegan(Set *pTouches, Event *pEvent);
- virtual void ccTouchesMoved(Set *pTouches, Event *pEvent);
+ virtual void ccTouchesBegan(Set *touches, Event *event);
+ virtual void ccTouchesMoved(Set *touches, Event *event);
Point _beginPos;
Menu* _itemMenu;
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp
index cb118e8595..a203dc5110 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp
@@ -81,7 +81,7 @@ SocketIOTestLayer::SocketIOTestLayer(void)
menuRequest->addChild(itemTestEndpointDisconnect);
// Sahred Status Label
- _sioClientStatus = LabelTTF::create("Not connected...", "Arial", 14, Size(320, 100), kTextAlignmentLeft);
+ _sioClientStatus = LabelTTF::create("Not connected...", "Arial", 14, Size(320, 100), Label::HAlignment::LEFT);
_sioClientStatus->setAnchorPoint(Point(0, 0));
_sioClientStatus->setPosition(Point(VisibleRect::left().x, VisibleRect::rightBottom().y));
this->addChild(_sioClientStatus);
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp
index d25c594d67..96b92e2199 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp
@@ -49,19 +49,19 @@ WebSocketTestLayer::WebSocketTestLayer()
// Send Text Status Label
- _sendTextStatus = LabelTTF::create("Send Text WS is waiting...", "Arial", 14, Size(160, 100), kTextAlignmentCenter, kVerticalTextAlignmentTop);
+ _sendTextStatus = LabelTTF::create("Send Text WS is waiting...", "Arial", 14, Size(160, 100), Label::HAlignment::CENTER, Label::VAlignment::TOP);
_sendTextStatus->setAnchorPoint(Point(0, 0));
_sendTextStatus->setPosition(Point(VisibleRect::left().x, VisibleRect::rightBottom().y + 25));
this->addChild(_sendTextStatus);
// Send Binary Status Label
- _sendBinaryStatus = LabelTTF::create("Send Binary WS is waiting...", "Arial", 14, Size(160, 100), kTextAlignmentCenter, kVerticalTextAlignmentTop);
+ _sendBinaryStatus = LabelTTF::create("Send Binary WS is waiting...", "Arial", 14, Size(160, 100), Label::HAlignment::CENTER, Label::VAlignment::TOP);
_sendBinaryStatus->setAnchorPoint(Point(0, 0));
_sendBinaryStatus->setPosition(Point(VisibleRect::left().x + 160, VisibleRect::rightBottom().y + 25));
this->addChild(_sendBinaryStatus);
// Error Label
- _errorStatus = LabelTTF::create("Error WS is waiting...", "Arial", 14, Size(160, 100), kTextAlignmentCenter, kVerticalTextAlignmentTop);
+ _errorStatus = LabelTTF::create("Error WS is waiting...", "Arial", 14, Size(160, 100), Label::HAlignment::CENTER, Label::VAlignment::TOP);
_errorStatus->setAnchorPoint(Point(0, 0));
_errorStatus->setPosition(Point(VisibleRect::left().x + 320, VisibleRect::rightBottom().y + 25));
this->addChild(_errorStatus);
diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp
index d70b165c7e..c12f388ce3 100644
--- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp
+++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp
@@ -14,6 +14,6 @@ void CustomTableViewCell::draw()
// Point(pos.x+size.width-1, pos.y+size.height-1),
// Point(pos.x+1, pos.y+size.height-1),
// };
-// ccDrawColor4B(0, 0, 255, 255);
-// ccDrawPoly(vertices, 4, true);
+// DrawPrimitives::drawColor4B(0, 0, 255, 255);
+// DrawPrimitives::drawPoly(vertices, 4, true);
}
diff --git a/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.cpp b/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.cpp
index f8dc9a46b9..f8444c4ae9 100644
--- a/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.cpp
@@ -68,7 +68,7 @@ void FileUtilsDemo::onEnter()
BaseTest::onEnter();
}
-void FileUtilsDemo::backCallback(Object* pSender)
+void FileUtilsDemo::backCallback(Object* sender)
{
Scene* scene = new FileUtilsTestScene();
Layer* layer = backAction();
@@ -78,7 +78,7 @@ void FileUtilsDemo::backCallback(Object* pSender)
scene->release();
}
-void FileUtilsDemo::nextCallback(Object* pSender)
+void FileUtilsDemo::nextCallback(Object* sender)
{
Scene* scene = new FileUtilsTestScene();
Layer* layer = nextAction();
@@ -88,7 +88,7 @@ void FileUtilsDemo::nextCallback(Object* pSender)
scene->release();
}
-void FileUtilsDemo::restartCallback(Object* pSender)
+void FileUtilsDemo::restartCallback(Object* sender)
{
Scene* scene = new FileUtilsTestScene();
Layer* layer = restartAction();
diff --git a/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.h b/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.h
index 79ecc65b57..d524d81a4b 100644
--- a/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.h
+++ b/samples/Cpp/TestCpp/Classes/FileUtilsTest/FileUtilsTest.h
@@ -19,9 +19,9 @@ public:
virtual void onEnter();
virtual string title();
virtual string subtitle();
- void backCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void restartCallback(Object* pSender);
+ void backCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void restartCallback(Object* sender);
};
class TestResolutionDirectories : public FileUtilsDemo
diff --git a/samples/Cpp/TestCpp/Classes/FontTest/FontTest.cpp b/samples/Cpp/TestCpp/Classes/FontTest/FontTest.cpp
index 04c5f2288d..1a2eda4167 100644
--- a/samples/Cpp/TestCpp/Classes/FontTest/FontTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/FontTest/FontTest.cpp
@@ -39,11 +39,11 @@ static std::string fontList[] =
static int fontCount = sizeof(fontList) / sizeof(*fontList);
static int vAlignIdx = 0;
-static VerticalTextAlignment verticalAlignment[] =
+static Label::VAlignment verticalAlignment[] =
{
- kVerticalTextAlignmentTop,
- kVerticalTextAlignmentCenter,
- kVerticalTextAlignmentBottom,
+ Label::VAlignment::TOP,
+ Label::VAlignment::CENTER,
+ Label::VAlignment::BOTTOM,
};
static int vAlignCount = sizeof(verticalAlignment) / sizeof(*verticalAlignment);
@@ -99,11 +99,11 @@ void FontTest::showFont(const char *pFont)
LabelTTF *top = LabelTTF::create(pFont, pFont, 24);
LabelTTF *left = LabelTTF::create("alignment left", pFont, fontSize,
- blockSize, kTextAlignmentLeft, verticalAlignment[vAlignIdx]);
+ blockSize, Label::HAlignment::LEFT, verticalAlignment[vAlignIdx]);
LabelTTF *center = LabelTTF::create("alignment center", pFont, fontSize,
- blockSize, kTextAlignmentCenter, verticalAlignment[vAlignIdx]);
+ blockSize, Label::HAlignment::CENTER, verticalAlignment[vAlignIdx]);
LabelTTF *right = LabelTTF::create("alignment right", pFont, fontSize,
- blockSize, kTextAlignmentRight, verticalAlignment[vAlignIdx]);
+ blockSize, Label::HAlignment::RIGHT, verticalAlignment[vAlignIdx]);
LayerColor *leftColor = LayerColor::create(Color4B(100, 100, 100, 255), blockSize.width, blockSize.height);
LayerColor *centerColor = LayerColor::create(Color4B(200, 100, 100, 255), blockSize.width, blockSize.height);
@@ -139,12 +139,12 @@ void FontTest::showFont(const char *pFont)
this->addChild(top, 0, kTagLabel4);
}
-void FontTest::backCallback(Object* pSender)
+void FontTest::backCallback(Object* sender)
{
showFont(backAction());
}
-void FontTest::nextCallback(Object* pSender)
+void FontTest::nextCallback(Object* sender)
{
showFont(nextAction());
}
@@ -154,7 +154,7 @@ std::string FontTest::title()
return "Font test";
}
-void FontTest::restartCallback(Object* pSender)
+void FontTest::restartCallback(Object* sender)
{
showFont(restartAction());
}
diff --git a/samples/Cpp/TestCpp/Classes/FontTest/FontTest.h b/samples/Cpp/TestCpp/Classes/FontTest/FontTest.h
index e84098ef99..1cbf6190d8 100644
--- a/samples/Cpp/TestCpp/Classes/FontTest/FontTest.h
+++ b/samples/Cpp/TestCpp/Classes/FontTest/FontTest.h
@@ -17,9 +17,9 @@ public:
FontTest();
void showFont(const char *pFont);
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
virtual std::string title();
CREATE_FUNC(FontTest);
diff --git a/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.cpp b/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.cpp
index bd8a693b4d..7dd610a3a0 100644
--- a/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.cpp
@@ -132,7 +132,7 @@ void AtlasDemo::onEnter()
BaseTest::onEnter();
}
-void AtlasDemo::restartCallback(Object* pSender)
+void AtlasDemo::restartCallback(Object* sender)
{
Scene* s = new AtlasTestScene();
s->addChild(restartAtlasAction());
@@ -141,7 +141,7 @@ void AtlasDemo::restartCallback(Object* pSender)
s->release();
}
-void AtlasDemo::nextCallback(Object* pSender)
+void AtlasDemo::nextCallback(Object* sender)
{
Scene* s = new AtlasTestScene();
s->addChild( nextAtlasAction() );
@@ -149,7 +149,7 @@ void AtlasDemo::nextCallback(Object* pSender)
s->release();
}
-void AtlasDemo::backCallback(Object* pSender)
+void AtlasDemo::backCallback(Object* sender)
{
Scene* s = new AtlasTestScene();
s->addChild( backAtlasAction() );
@@ -348,19 +348,19 @@ LabelTTFAlignment::LabelTTFAlignment()
Size s = Director::getInstance()->getWinSize();
LabelTTF* ttf0 = LabelTTF::create("Alignment 0\nnew line", "Helvetica", 12,
- Size(256, 32), kTextAlignmentLeft);
+ Size(256, 32), Label::HAlignment::LEFT);
ttf0->setPosition(Point(s.width/2,(s.height/6)*2));
ttf0->setAnchorPoint(Point(0.5f,0.5f));
this->addChild(ttf0);
LabelTTF* ttf1 = LabelTTF::create("Alignment 1\nnew line", "Helvetica", 12,
- Size(245, 32), kTextAlignmentCenter);
+ Size(245, 32), Label::HAlignment::CENTER);
ttf1->setPosition(Point(s.width/2,(s.height/6)*3));
ttf1->setAnchorPoint(Point(0.5f,0.5f));
this->addChild(ttf1);
LabelTTF* ttf2 = LabelTTF::create("Alignment 2\nnew line", "Helvetica", 12,
- Size(245, 32), kTextAlignmentRight);
+ Size(245, 32), Label::HAlignment::RIGHT);
ttf2->setPosition(Point(s.width/2,(s.height/6)*4));
ttf2->setAnchorPoint(Point(0.5f,0.5f));
this->addChild(ttf2);
@@ -523,8 +523,8 @@ Atlas4::Atlas4()
void Atlas4::draw()
{
Size s = Director::getInstance()->getWinSize();
- ccDrawLine( Point(0, s.height/2), Point(s.width, s.height/2) );
- ccDrawLine( Point(s.width/2, 0), Point(s.width/2, s.height) );
+ DrawPrimitives::drawLine( Point(0, s.height/2), Point(s.width, s.height/2) );
+ DrawPrimitives::drawLine( Point(s.width/2, 0), Point(s.width/2, s.height) );
}
void Atlas4::step(float dt)
@@ -953,8 +953,8 @@ LabelTTFTest::LabelTTFTest()
this->addChild(menu);
_plabel = NULL;
- _horizAlign = kTextAlignmentLeft;
- _vertAlign = kVerticalTextAlignmentTop;
+ _horizAlign = Label::HAlignment::LEFT;
+ _vertAlign = Label::VAlignment::TOP;
this->updateAlignment();
}
@@ -986,39 +986,39 @@ void LabelTTFTest::updateAlignment()
this->addChild(_plabel);
}
-void LabelTTFTest::setAlignmentLeft(Object* pSender)
+void LabelTTFTest::setAlignmentLeft(Object* sender)
{
- _horizAlign = kTextAlignmentLeft;
+ _horizAlign = Label::HAlignment::LEFT;
this->updateAlignment();
}
-void LabelTTFTest::setAlignmentCenter(Object* pSender)
+void LabelTTFTest::setAlignmentCenter(Object* sender)
{
- _horizAlign = kTextAlignmentCenter;
+ _horizAlign = Label::HAlignment::CENTER;
this->updateAlignment();
}
-void LabelTTFTest::setAlignmentRight(Object* pSender)
+void LabelTTFTest::setAlignmentRight(Object* sender)
{
- _horizAlign = kTextAlignmentRight;
+ _horizAlign = Label::HAlignment::RIGHT;
this->updateAlignment();
}
-void LabelTTFTest::setAlignmentTop(Object* pSender)
+void LabelTTFTest::setAlignmentTop(Object* sender)
{
- _vertAlign = kVerticalTextAlignmentTop;
+ _vertAlign = Label::VAlignment::TOP;
this->updateAlignment();
}
-void LabelTTFTest::setAlignmentMiddle(Object* pSender)
+void LabelTTFTest::setAlignmentMiddle(Object* sender)
{
- _vertAlign = kVerticalTextAlignmentCenter;
+ _vertAlign = Label::VAlignment::CENTER;
this->updateAlignment();
}
-void LabelTTFTest::setAlignmentBottom(Object* pSender)
+void LabelTTFTest::setAlignmentBottom(Object* sender)
{
- _vertAlign = kVerticalTextAlignmentBottom;
+ _vertAlign = Label::VAlignment::BOTTOM;
this->updateAlignment();
}
@@ -1027,24 +1027,24 @@ const char* LabelTTFTest::getCurrentAlignment()
const char* vertical = NULL;
const char* horizontal = NULL;
switch (_vertAlign) {
- case kVerticalTextAlignmentTop:
+ case Label::VAlignment::TOP:
vertical = "Top";
break;
- case kVerticalTextAlignmentCenter:
+ case Label::VAlignment::CENTER:
vertical = "Middle";
break;
- case kVerticalTextAlignmentBottom:
+ case Label::VAlignment::BOTTOM:
vertical = "Bottom";
break;
}
switch (_horizAlign) {
- case kTextAlignmentLeft:
+ case Label::HAlignment::LEFT:
horizontal = "Left";
break;
- case kTextAlignmentCenter:
+ case Label::HAlignment::CENTER:
horizontal = "Center";
break;
- case kTextAlignmentRight:
+ case Label::HAlignment::RIGHT:
horizontal = "Right";
break;
}
@@ -1070,8 +1070,8 @@ LabelTTFMultiline::LabelTTFMultiline()
"Paint Boy",
32,
Size(s.width/2,200),
- kTextAlignmentCenter,
- kVerticalTextAlignmentTop);
+ Label::HAlignment::CENTER,
+ Label::VAlignment::TOP);
center->setPosition(Point(s.width / 2, 150));
@@ -1141,7 +1141,7 @@ BitmapFontMultiLineAlignment::BitmapFontMultiLineAlignment()
Size size = Director::getInstance()->getWinSize();
// create and initialize a Label
- this->_labelShouldRetain = LabelBMFont::create(LongSentencesExample, "fonts/markerFelt.fnt", size.width/1.5, kTextAlignmentCenter);
+ this->_labelShouldRetain = LabelBMFont::create(LongSentencesExample, "fonts/markerFelt.fnt", size.width/1.5, Label::HAlignment::CENTER);
this->_labelShouldRetain->retain();
this->_arrowsBarShouldRetain = Sprite::create("Images/arrowsBar.png");
@@ -1250,13 +1250,13 @@ void BitmapFontMultiLineAlignment::alignmentChanged(cocos2d::Object *sender)
switch(item->getTag())
{
case LeftAlign:
- this->_labelShouldRetain->setAlignment(kTextAlignmentLeft);
+ this->_labelShouldRetain->setAlignment(Label::HAlignment::LEFT);
break;
case CenterAlign:
- this->_labelShouldRetain->setAlignment(kTextAlignmentCenter);
+ this->_labelShouldRetain->setAlignment(Label::HAlignment::CENTER);
break;
case RightAlign:
- this->_labelShouldRetain->setAlignment(kTextAlignmentRight);
+ this->_labelShouldRetain->setAlignment(Label::HAlignment::RIGHT);
break;
default:
@@ -1266,9 +1266,9 @@ void BitmapFontMultiLineAlignment::alignmentChanged(cocos2d::Object *sender)
this->snapArrowsToEdge();
}
-void BitmapFontMultiLineAlignment::ccTouchesBegan(cocos2d::Set *pTouches, cocos2d::Event *pEvent)
+void BitmapFontMultiLineAlignment::ccTouchesBegan(cocos2d::Set *touches, cocos2d::Event *event)
{
- Touch *touch = (Touch *)pTouches->anyObject();
+ Touch *touch = (Touch *)touches->anyObject();
Point location = touch->getLocationInView();
if (this->_arrowsShouldRetain->getBoundingBox().containsPoint(location))
@@ -1278,7 +1278,7 @@ void BitmapFontMultiLineAlignment::ccTouchesBegan(cocos2d::Set *pTouches, cocos2
}
}
-void BitmapFontMultiLineAlignment::ccTouchesEnded(cocos2d::Set *pTouches, cocos2d::Event *pEvent)
+void BitmapFontMultiLineAlignment::ccTouchesEnded(cocos2d::Set *touches, cocos2d::Event *event)
{
_drag = false;
this->snapArrowsToEdge();
@@ -1286,14 +1286,14 @@ void BitmapFontMultiLineAlignment::ccTouchesEnded(cocos2d::Set *pTouches, cocos2
this->_arrowsBarShouldRetain->setVisible(false);
}
-void BitmapFontMultiLineAlignment::ccTouchesMoved(cocos2d::Set *pTouches, cocos2d::Event *pEvent)
+void BitmapFontMultiLineAlignment::ccTouchesMoved(cocos2d::Set *touches, cocos2d::Event *event)
{
if (! _drag)
{
return;
}
- Touch *touch = (Touch *)pTouches->anyObject();
+ Touch *touch = (Touch *)touches->anyObject();
Point location = touch->getLocationInView();
Size winSize = Director::getInstance()->getWinSize();
@@ -1348,11 +1348,11 @@ BMFontOneAtlas::BMFontOneAtlas()
{
Size s = Director::getInstance()->getWinSize();
- auto label1 = LabelBMFont::create("This is Helvetica", "fonts/helvetica-32.fnt", kLabelAutomaticWidth, kTextAlignmentLeft, Point::ZERO);
+ auto label1 = LabelBMFont::create("This is Helvetica", "fonts/helvetica-32.fnt", kLabelAutomaticWidth, Label::HAlignment::LEFT, Point::ZERO);
addChild(label1);
label1->setPosition(Point(s.width/2, s.height/3*2));
- auto label2 = LabelBMFont::create("And this is Geneva", "fonts/geneva-32.fnt", kLabelAutomaticWidth, kTextAlignmentLeft, Point(0, 128));
+ auto label2 = LabelBMFont::create("And this is Geneva", "fonts/geneva-32.fnt", kLabelAutomaticWidth, Label::HAlignment::LEFT, Point(0, 128));
addChild(label2);
label2->setPosition(Point(s.width/2, s.height/3*1));
}
@@ -1379,7 +1379,7 @@ BMFontUnicode::BMFontUnicode()
Size s = Director::getInstance()->getWinSize();
- auto label1 = LabelBMFont::create(spanish, "fonts/arial-unicode-26.fnt", 200, kTextAlignmentLeft);
+ auto label1 = LabelBMFont::create(spanish, "fonts/arial-unicode-26.fnt", 200, Label::HAlignment::LEFT);
addChild(label1);
label1->setPosition(Point(s.width/2, s.height/5*4));
@@ -1611,6 +1611,6 @@ void LabelBMFontBounds::draw()
Point(labelSize.width + origin.width, labelSize.height + origin.height),
Point(origin.width, labelSize.height + origin.height)
};
- ccDrawPoly(vertices, 4, true);
+ DrawPrimitives::drawPoly(vertices, 4, true);
}
diff --git a/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.h b/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.h
index df57d27b7d..dec68cacaf 100644
--- a/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.h
+++ b/samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.h
@@ -16,9 +16,9 @@ public:
virtual std::string subtitle();
virtual void onEnter();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
};
@@ -181,18 +181,18 @@ public:
virtual std::string title();
virtual std::string subtitle();
private:
- void setAlignmentLeft(Object* pSender);
- void setAlignmentCenter(Object* pSender);
- void setAlignmentRight(Object* pSender);
- void setAlignmentTop(Object* pSender);
- void setAlignmentMiddle(Object* pSender);
- void setAlignmentBottom(Object* pSender);
+ void setAlignmentLeft(Object* sender);
+ void setAlignmentCenter(Object* sender);
+ void setAlignmentRight(Object* sender);
+ void setAlignmentTop(Object* sender);
+ void setAlignmentMiddle(Object* sender);
+ void setAlignmentBottom(Object* sender);
void updateAlignment();
const char* getCurrentAlignment();
private:
LabelTTF* _plabel;
- TextAlignment _horizAlign;
- VerticalTextAlignment _vertAlign;
+ Label::HAlignment _horizAlign;
+ Label::VAlignment _vertAlign;
};
class LabelTTFMultiline : public AtlasDemo
@@ -227,9 +227,9 @@ public:
virtual std::string subtitle();
void stringChanged(Object *sender);
void alignmentChanged(Object *sender);
- virtual void ccTouchesBegan(Set *pTouches, Event *pEvent);
- virtual void ccTouchesEnded(Set *pTouches, Event *pEvent);
- virtual void ccTouchesMoved(Set *pTouches, Event *pEvent);
+ virtual void ccTouchesBegan(Set *touches, Event *event);
+ virtual void ccTouchesEnded(Set *touches, Event *event);
+ virtual void ccTouchesMoved(Set *touches, Event *event);
public:
LabelBMFont *_labelShouldRetain;
diff --git a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp
index 1cf2d902a6..ea266cc6b7 100644
--- a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp
@@ -89,7 +89,7 @@ void LayerTest::onEnter()
BaseTest::onEnter();
}
-void LayerTest::restartCallback(Object* pSender)
+void LayerTest::restartCallback(Object* sender)
{
Scene* s = new LayerTestScene();
s->addChild(restartAction());
@@ -98,7 +98,7 @@ void LayerTest::restartCallback(Object* pSender)
s->release();
}
-void LayerTest::nextCallback(Object* pSender)
+void LayerTest::nextCallback(Object* sender)
{
Scene* s = new LayerTestScene();
s->addChild( nextAction() );
@@ -106,7 +106,7 @@ void LayerTest::nextCallback(Object* pSender)
s->release();
}
-void LayerTest::backCallback(Object* pSender)
+void LayerTest::backCallback(Object* sender)
{
Scene* s = new LayerTestScene();
s->addChild( backAction() );
@@ -470,22 +470,22 @@ void LayerTest1::updateSize(Point &touchLocation)
l->setContentSize( newSize );
}
-void LayerTest1::ccTouchesBegan(Set *pTouches, Event *pEvent)
+void LayerTest1::ccTouchesBegan(Set *touches, Event *event)
{
- ccTouchesMoved(pTouches, pEvent);
+ ccTouchesMoved(touches, event);
}
-void LayerTest1::ccTouchesMoved(Set *pTouches, Event *pEvent)
+void LayerTest1::ccTouchesMoved(Set *touches, Event *event)
{
- Touch *touch = (Touch*)pTouches->anyObject();
+ Touch *touch = static_cast(touches->anyObject());
Point touchLocation = touch->getLocation();
updateSize(touchLocation);
}
-void LayerTest1::ccTouchesEnded(Set *pTouches, Event *pEvent)
+void LayerTest1::ccTouchesEnded(Set *touches, Event *event)
{
- ccTouchesMoved(pTouches, pEvent);
+ ccTouchesMoved(touches, event);
}
std::string LayerTest1::title()
@@ -858,10 +858,7 @@ LayerExtendedBlendOpacityTest::LayerExtendedBlendOpacityTest()
layer3->setEndColor(Color3B(255, 0, 255));
layer3->setStartOpacity(255);
layer3->setEndOpacity(255);
- BlendFunc blend;
- blend.src = GL_SRC_ALPHA;
- blend.dst = GL_ONE_MINUS_SRC_ALPHA;
- layer3->setBlendFunc(blend);
+ layer3->setBlendFunc( BlendFunc::ALPHA_NON_PREMULTIPLIED );
addChild(layer3);
}
diff --git a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h
index 7dd3186959..eba08c1dab 100644
--- a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h
+++ b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h
@@ -18,9 +18,9 @@ public:
virtual std::string subtitle();
virtual void onEnter();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
};
class LayerTestCascadingOpacityA : public LayerTest
@@ -74,9 +74,9 @@ public:
void updateSize(Point &touchLocation);
- virtual void ccTouchesBegan(Set *pTouches, Event *pEvent);
- virtual void ccTouchesMoved(Set *pTouches, Event *pEvent);
- virtual void ccTouchesEnded(Set *pTouches, Event *pEvent);
+ virtual void ccTouchesBegan(Set *touches, Event *event);
+ virtual void ccTouchesMoved(Set *touches, Event *event);
+ virtual void ccTouchesEnded(Set *touches, Event *event);
};
class LayerTest2 : public LayerTest
diff --git a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp b/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp
index 835349b3b2..444ced5b9e 100644
--- a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.cpp
@@ -26,8 +26,8 @@ enum {
MenuLayerMainMenu::MenuLayerMainMenu()
{
setTouchEnabled(true);
- setTouchPriority(kMenuHandlerPriority + 1);
- setTouchMode(kTouchesOneByOne);
+ setTouchPriority(Menu::HANDLER_PRIORITY + 1);
+ setTouchMode(Touch::DispatchMode::ONE_BY_ONE);
// Font Item
Sprite* spriteNormal = Sprite::create(s_MenuItem, Rect(0,23*2,115,23));
@@ -114,20 +114,20 @@ MenuLayerMainMenu::MenuLayerMainMenu()
menu->setPosition(Point(s.width/2, s.height/2));
}
-bool MenuLayerMainMenu::ccTouchBegan(Touch *touch, Event * pEvent)
+bool MenuLayerMainMenu::ccTouchBegan(Touch *touch, Event * event)
{
return true;
}
-void MenuLayerMainMenu::ccTouchEnded(Touch *touch, Event * pEvent)
+void MenuLayerMainMenu::ccTouchEnded(Touch *touch, Event * event)
{
}
-void MenuLayerMainMenu::ccTouchCancelled(Touch *touch, Event * pEvent)
+void MenuLayerMainMenu::ccTouchCancelled(Touch *touch, Event * event)
{
}
-void MenuLayerMainMenu::ccTouchMoved(Touch *touch, Event * pEvent)
+void MenuLayerMainMenu::ccTouchMoved(Touch *touch, Event * event)
{
}
@@ -149,7 +149,7 @@ void MenuLayerMainMenu::menuCallbackConfig(Object* sender)
void MenuLayerMainMenu::allowTouches(float dt)
{
Director* director = Director::getInstance();
- director->getTouchDispatcher()->setPriority(kMenuHandlerPriority+1, this);
+ director->getTouchDispatcher()->setPriority(Menu::HANDLER_PRIORITY+1, this);
unscheduleAllSelectors();
log("TOUCHES ALLOWED AGAIN");
}
@@ -158,7 +158,7 @@ void MenuLayerMainMenu::menuCallbackDisabled(Object* sender)
{
// hijack all touch events for 5 seconds
Director* director = Director::getInstance();
- director->getTouchDispatcher()->setPriority(kMenuHandlerPriority-1, this);
+ director->getTouchDispatcher()->setPriority(Menu::HANDLER_PRIORITY-1, this);
schedule(schedule_selector(MenuLayerMainMenu::allowTouches), 5.0f);
log("TOUCHES DISABLED FOR 5 SECONDS");
}
@@ -168,7 +168,7 @@ void MenuLayerMainMenu::menuCallback2(Object* sender)
static_cast(_parent)->switchTo(2);
}
-void MenuLayerMainMenu::menuCallbackPriorityTest(Object* pSender)
+void MenuLayerMainMenu::menuCallbackPriorityTest(Object* sender)
{
static_cast(_parent)->switchTo(4);
}
@@ -491,10 +491,10 @@ MenuLayerPriorityTest::MenuLayerPriorityTest()
MenuItemFont::setFontSize(48);
item1 = MenuItemFont::create("Toggle priority", [&](Object *sender) {
if( _priority) {
- _menu2->setHandlerPriority(kMenuHandlerPriority + 20);
+ _menu2->setHandlerPriority(Menu::HANDLER_PRIORITY + 20);
_priority = false;
} else {
- _menu2->setHandlerPriority(kMenuHandlerPriority - 20);
+ _menu2->setHandlerPriority(Menu::HANDLER_PRIORITY - 20);
_priority = true;
}
});
@@ -509,7 +509,7 @@ MenuLayerPriorityTest::~MenuLayerPriorityTest()
}
-void MenuLayerPriorityTest::menuCallback(Object* pSender)
+void MenuLayerPriorityTest::menuCallback(Object* sender)
{
static_cast(_parent)->switchTo(0);
// [[Director sharedDirector] poscene];
@@ -590,12 +590,12 @@ void RemoveMenuItemWhenMove::registerWithTouchDispatcher(void)
Director::getInstance()->getTouchDispatcher()->addTargetedDelegate(this, -129, false);
}
-bool RemoveMenuItemWhenMove::ccTouchBegan(Touch *pTouch, Event *pEvent)
+bool RemoveMenuItemWhenMove::ccTouchBegan(Touch *touch, Event *event)
{
return true;
}
-void RemoveMenuItemWhenMove::ccTouchMoved(Touch *pTouch, Event *pEvent)
+void RemoveMenuItemWhenMove::ccTouchMoved(Touch *touch, Event *event)
{
if (item)
{
diff --git a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.h b/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.h
index 1a2600b0ff..1f227402f4 100644
--- a/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.h
+++ b/samples/Cpp/TestCpp/Classes/MenuTest/MenuTest.h
@@ -14,19 +14,19 @@ public:
~MenuLayerMainMenu();
public:
- virtual bool ccTouchBegan(Touch *touch, Event * pEvent);
- virtual void ccTouchEnded(Touch *touch, Event * pEvent);
- virtual void ccTouchCancelled(Touch *touch, Event * pEvent);
- virtual void ccTouchMoved(Touch *touch, Event * pEvent);
+ virtual bool ccTouchBegan(Touch *touch, Event * event);
+ virtual void ccTouchEnded(Touch *touch, Event * event);
+ virtual void ccTouchCancelled(Touch *touch, Event * event);
+ virtual void ccTouchMoved(Touch *touch, Event * event);
void allowTouches(float dt);
- void menuCallback(Object* pSender);
- void menuCallbackConfig(Object* pSender);
- void menuCallbackDisabled(Object* pSender);
- void menuCallback2(Object* pSender);
- void menuCallbackPriorityTest(Object* pSender);
+ void menuCallback(Object* sender);
+ void menuCallbackConfig(Object* sender);
+ void menuCallbackDisabled(Object* sender);
+ void menuCallback2(Object* sender);
+ void menuCallbackPriorityTest(Object* sender);
void menuCallbackBugsTest(Object *pSender);
- void onQuit(Object* pSender);
+ void onQuit(Object* sender);
void menuMovingCallback(Object *pSender);
//CREATE_NODE(MenuLayer1);
@@ -46,9 +46,9 @@ public:
~MenuLayer2();
public:
- void menuCallback(Object* pSender);
- void menuCallbackOpacity(Object* pSender);
- void menuCallbackAlign(Object* pSender);
+ void menuCallback(Object* sender);
+ void menuCallbackOpacity(Object* sender);
+ void menuCallbackAlign(Object* sender);
//CREATE_NODE(MenuLayer2);
};
@@ -72,8 +72,8 @@ public:
~MenuLayer4();
public:
- void menuCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void menuCallback(Object* sender);
+ void backCallback(Object* sender);
//CREATE_NODE(MenuLayer4);
};
@@ -84,7 +84,7 @@ public:
MenuLayerPriorityTest();
~MenuLayerPriorityTest();
- void menuCallback(Object* pSender);
+ void menuCallback(Object* sender);
private:
Menu* _menu1;
Menu* _menu2;
@@ -108,8 +108,8 @@ public:
~RemoveMenuItemWhenMove();
virtual void registerWithTouchDispatcher(void);
- virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent);
- virtual void ccTouchMoved(Touch *pTouch, Event *pEvent);
+ virtual bool ccTouchBegan(Touch *touch, Event *event);
+ virtual void ccTouchMoved(Touch *touch, Event *event);
void goBack(Object *pSender);
diff --git a/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp b/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp
index b8a2019e55..54aaf4db86 100644
--- a/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp
@@ -234,7 +234,7 @@ void MotionStreakTest::modeCallback(Object *pSender)
streak->setFastMode(! fastMode);
}
-void MotionStreakTest::restartCallback(Object* pSender)
+void MotionStreakTest::restartCallback(Object* sender)
{
Scene* s = new MotionStreakTestScene();//CCScene::create();
s->addChild(restartMotionAction());
@@ -243,7 +243,7 @@ void MotionStreakTest::restartCallback(Object* pSender)
s->release();
}
-void MotionStreakTest::nextCallback(Object* pSender)
+void MotionStreakTest::nextCallback(Object* sender)
{
Scene* s = new MotionStreakTestScene();//CCScene::create();
s->addChild( nextMotionAction() );
@@ -251,7 +251,7 @@ void MotionStreakTest::nextCallback(Object* pSender)
s->release();
}
-void MotionStreakTest::backCallback(Object* pSender)
+void MotionStreakTest::backCallback(Object* sender)
{
Scene* s = new MotionStreakTestScene;//CCScene::create();
s->addChild( backMotionAction() );
diff --git a/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.h b/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.h
index eb4adfd0d5..84ee4437aa 100644
--- a/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.h
+++ b/samples/Cpp/TestCpp/Classes/MotionStreakTest/MotionStreakTest.h
@@ -17,10 +17,10 @@ public:
virtual std::string subtitle();
virtual void onEnter();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
- void modeCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
+ void modeCallback(Object* sender);
protected:
MotionStreak *streak;
};
diff --git a/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.cpp b/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.cpp
index c58e0944f2..0a2b9875cb 100644
--- a/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.cpp
@@ -14,18 +14,18 @@ class TouchPoint : public Node
public:
TouchPoint()
{
- setShaderProgram(ShaderCache::getInstance()->programForKey(kShader_PositionTextureColor));
+ setShaderProgram(ShaderCache::getInstance()->programForKey(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
}
virtual void draw()
{
- ccDrawColor4B(_touchColor.r, _touchColor.g, _touchColor.b, 255);
+ DrawPrimitives::setDrawColor4B(_touchColor.r, _touchColor.g, _touchColor.b, 255);
glLineWidth(10);
- ccDrawLine( Point(0, _touchPoint.y), Point(getContentSize().width, _touchPoint.y) );
- ccDrawLine( Point(_touchPoint.x, 0), Point(_touchPoint.x, getContentSize().height) );
+ DrawPrimitives::drawLine( Point(0, _touchPoint.y), Point(getContentSize().width, _touchPoint.y) );
+ DrawPrimitives::drawLine( Point(_touchPoint.x, 0), Point(_touchPoint.x, getContentSize().height) );
glLineWidth(1);
- ccPointSize(30);
- ccDrawPoint(_touchPoint);
+ DrawPrimitives::setPointSize(30);
+ DrawPrimitives::drawPoint(_touchPoint);
}
void setTouchPos(const Point& pt)
@@ -69,50 +69,50 @@ void MutiTouchTestLayer::registerWithTouchDispatcher(void)
Director::getInstance()->getTouchDispatcher()->addStandardDelegate(this, 0);
}
-void MutiTouchTestLayer::ccTouchesBegan(Set *touches, Event *pEvent)
+void MutiTouchTestLayer::ccTouchesBegan(Set *touches, Event *event)
{
for ( auto &item: *touches )
{
- Touch* pTouch = (Touch*)item;
- TouchPoint* pTouchPoint = TouchPoint::touchPointWithParent(this);
- Point location = pTouch->getLocation();
+ Touch* touch = static_cast(item);
+ TouchPoint* touchPoint = TouchPoint::touchPointWithParent(this);
+ Point location = touch->getLocation();
- pTouchPoint->setTouchPos(location);
- pTouchPoint->setTouchColor(s_TouchColors[pTouch->getID()]);
+ touchPoint->setTouchPos(location);
+ touchPoint->setTouchColor(s_TouchColors[touch->getID()]);
- addChild(pTouchPoint);
- s_dic.setObject(pTouchPoint, pTouch->getID());
+ addChild(touchPoint);
+ s_dic.setObject(touchPoint, touch->getID());
}
}
-void MutiTouchTestLayer::ccTouchesMoved(Set *touches, Event *pEvent)
+void MutiTouchTestLayer::ccTouchesMoved(Set *touches, Event *event)
{
for( auto &item: *touches)
{
- Touch* pTouch = (Touch*)item;
- TouchPoint* pTP = (TouchPoint*)s_dic.objectForKey(pTouch->getID());
- Point location = pTouch->getLocation();
+ Touch* touch = static_cast(item);
+ TouchPoint* pTP = static_cast(s_dic.objectForKey(touch->getID()));
+ Point location = touch->getLocation();
pTP->setTouchPos(location);
}
}
-void MutiTouchTestLayer::ccTouchesEnded(Set *touches, Event *pEvent)
+void MutiTouchTestLayer::ccTouchesEnded(Set *touches, Event *event)
{
for ( auto &item: *touches )
{
- Touch* pTouch = (Touch*)item;
- TouchPoint* pTP = (TouchPoint*)s_dic.objectForKey(pTouch->getID());
+ Touch* touch = static_cast(item);
+ TouchPoint* pTP = static_cast(s_dic.objectForKey(touch->getID()));
removeChild(pTP, true);
- s_dic.removeObjectForKey(pTouch->getID());
+ s_dic.removeObjectForKey(touch->getID());
}
}
-void MutiTouchTestLayer::ccTouchesCancelled(Set *pTouches, Event *pEvent)
+void MutiTouchTestLayer::ccTouchesCancelled(Set *touches, Event *event)
{
- ccTouchesEnded(pTouches, pEvent);
+ ccTouchesEnded(touches, event);
}
void MutiTouchTestScene::runThisTest()
diff --git a/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.h b/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.h
index d6d8e263b1..0f3190c6ce 100644
--- a/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.h
+++ b/samples/Cpp/TestCpp/Classes/MutiTouchTest/MutiTouchTest.h
@@ -9,10 +9,10 @@ public:
bool init();
virtual void registerWithTouchDispatcher(void);
- virtual void ccTouchesBegan(cocos2d::Set *pTouches, cocos2d::Event *pEvent);
- virtual void ccTouchesMoved(cocos2d::Set *pTouches, cocos2d::Event *pEvent);
- virtual void ccTouchesEnded(cocos2d::Set *pTouches, cocos2d::Event *pEvent);
- virtual void ccTouchesCancelled(cocos2d::Set *pTouches, cocos2d::Event *pEvent);
+ virtual void ccTouchesBegan(cocos2d::Set *touches, cocos2d::Event *event);
+ virtual void ccTouchesMoved(cocos2d::Set *touches, cocos2d::Event *event);
+ virtual void ccTouchesEnded(cocos2d::Set *touches, cocos2d::Event *event);
+ virtual void ccTouchesCancelled(cocos2d::Set *touches, cocos2d::Event *event);
CREATE_FUNC(MutiTouchTestLayer)
};
diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp
index c16bee5a37..d48313c472 100644
--- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp
@@ -103,7 +103,7 @@ void TestCocosNodeDemo::onEnter()
BaseTest::onEnter();
}
-void TestCocosNodeDemo::restartCallback(Object* pSender)
+void TestCocosNodeDemo::restartCallback(Object* sender)
{
Scene* s = new CocosNodeTestScene();//CCScene::create();
s->addChild(restartCocosNodeAction());
@@ -112,7 +112,7 @@ void TestCocosNodeDemo::restartCallback(Object* pSender)
s->release();
}
-void TestCocosNodeDemo::nextCallback(Object* pSender)
+void TestCocosNodeDemo::nextCallback(Object* sender)
{
Scene* s = new CocosNodeTestScene();//CCScene::create();
s->addChild( nextCocosNodeAction() );
@@ -120,7 +120,7 @@ void TestCocosNodeDemo::nextCallback(Object* pSender)
s->release();
}
-void TestCocosNodeDemo::backCallback(Object* pSender)
+void TestCocosNodeDemo::backCallback(Object* sender)
{
Scene* s = new CocosNodeTestScene();//CCScene::create();
s->addChild( backCocosNodeAction() );
@@ -512,12 +512,12 @@ std::string NodeToWorld::title()
void CameraOrbitTest::onEnter()
{
TestCocosNodeDemo::onEnter();
- Director::getInstance()->setProjection(kDirectorProjection3D);
+ Director::getInstance()->setProjection(Director::Projection::_3D);
}
void CameraOrbitTest::onExit()
{
- Director::getInstance()->setProjection(kDirectorProjection2D);
+ Director::getInstance()->setProjection(Director::Projection::_2D);
TestCocosNodeDemo::onExit();
}
@@ -584,12 +584,12 @@ void CameraZoomTest::onEnter()
{
TestCocosNodeDemo::onEnter();
- Director::getInstance()->setProjection(kDirectorProjection3D);
+ Director::getInstance()->setProjection(Director::Projection::_3D);
}
void CameraZoomTest::onExit()
{
- Director::getInstance()->setProjection(kDirectorProjection2D);
+ Director::getInstance()->setProjection(Director::Projection::_2D);
TestCocosNodeDemo::onExit();
}
@@ -797,8 +797,7 @@ NodeOpaqueTest::NodeOpaqueTest()
for (int i = 0; i < 50; i++)
{
background = Sprite::create("Images/background1.png");
- BlendFunc blendFunc = {GL_ONE, GL_ONE_MINUS_SRC_ALPHA};
- background->setBlendFunc(blendFunc);
+ background->setBlendFunc( BlendFunc::ALPHA_PREMULTIPLIED );
background->setAnchorPoint(Point::ZERO);
addChild(background);
}
@@ -823,7 +822,7 @@ NodeNonOpaqueTest::NodeNonOpaqueTest()
for (int i = 0; i < 50; i++)
{
background = Sprite::create("Images/background1.jpg");
- background->setBlendFunc(BlendFunc::BLEND_FUNC_DISABLE);
+ background->setBlendFunc(BlendFunc::DISABLE);
background->setAnchorPoint(Point::ZERO);
addChild(background);
}
diff --git a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h
index ff220a6bff..a507f60599 100644
--- a/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h
+++ b/samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.h
@@ -15,9 +15,9 @@ public:
virtual std::string subtitle();
virtual void onEnter();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
};
class Test2 : public TestCocosNodeDemo
diff --git a/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.cpp b/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.cpp
index 0ede68f9cf..31d9fca350 100644
--- a/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.cpp
@@ -132,9 +132,9 @@ Parallax2::Parallax2()
addChild(voidNode, 0, kTagNode);
}
-void Parallax2::ccTouchesMoved(Set *pTouches, Event *pEvent)
+void Parallax2::ccTouchesMoved(Set *touches, Event *event)
{
- Touch *touch = (Touch*)pTouches->anyObject();
+ Touch *touch = static_cast(touches->anyObject());
Point diff = touch->getDelta();
Node* node = getChildByTag(kTagNode);
@@ -219,7 +219,7 @@ void ParallaxDemo::onEnter()
BaseTest::onEnter();
}
-void ParallaxDemo::restartCallback(Object* pSender)
+void ParallaxDemo::restartCallback(Object* sender)
{
Scene* s = new ParallaxTestScene();
s->addChild(restartParallaxAction());
@@ -228,7 +228,7 @@ void ParallaxDemo::restartCallback(Object* pSender)
s->release();
}
-void ParallaxDemo::nextCallback(Object* pSender)
+void ParallaxDemo::nextCallback(Object* sender)
{
Scene* s = new ParallaxTestScene();
s->addChild( nextParallaxAction() );
@@ -236,7 +236,7 @@ void ParallaxDemo::nextCallback(Object* pSender)
s->release();
}
-void ParallaxDemo::backCallback(Object* pSender)
+void ParallaxDemo::backCallback(Object* sender)
{
Scene* s = new ParallaxTestScene();
s->addChild( backParallaxAction() );
diff --git a/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.h b/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.h
index 24cd640da0..1dded76eb7 100644
--- a/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.h
+++ b/samples/Cpp/TestCpp/Classes/ParallaxTest/ParallaxTest.h
@@ -16,9 +16,9 @@ public:
virtual std::string title();
virtual void onEnter();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
};
class Parallax1 : public ParallaxDemo
@@ -43,7 +43,7 @@ protected:
public:
Parallax2();
- virtual void ccTouchesMoved(Set *pTouches, Event *pEvent);
+ virtual void ccTouchesMoved(Set *touches, Event *event);
virtual std::string title();
};
diff --git a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp b/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp
index 4236714244..7347ab5ce2 100644
--- a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.cpp
@@ -1,11 +1,5 @@
#include "ParticleTest.h"
-// #include "CCActionInterval.h"
-// #include "CCMenu.h"
-// #include "CCLabelTTF.h"
-// #include "CCLabelAtlas.h"
-// #include "touch_dispatcher/CCTouchDispatcher.h"
#include "../testResource.h"
-/*#include "support/CCPointExtension.h"*/
enum {
kTagParticleCount = 1,
@@ -200,7 +194,7 @@ void DemoBigFlower::onEnter()
// size, in pixels
_emitter->setStartSize(80.0f);
_emitter->setStartSizeVar(40.0f);
- _emitter->setEndSize(kParticleStartSizeEqualToEndSize);
+ _emitter->setEndSize(ParticleSystem::START_SIZE_EQUAL_TO_END_SIZE);
// emits per second
_emitter->setEmissionRate(_emitter->getTotalParticles()/_emitter->getLife());
@@ -285,7 +279,7 @@ void DemoRotFlower::onEnter()
// size, in pixels
_emitter->setStartSize(30.0f);
_emitter->setStartSizeVar(00.0f);
- _emitter->setEndSize(kParticleStartSizeEqualToEndSize);
+ _emitter->setEndSize(ParticleSystem::START_SIZE_EQUAL_TO_END_SIZE);
// emits per second
_emitter->setEmissionRate(_emitter->getTotalParticles()/_emitter->getLife());
@@ -650,10 +644,10 @@ void RadiusMode1::onEnter()
_emitter->setTexture(TextureCache::getInstance()->addImage("Images/stars-grayscale.png"));
// duration
- _emitter->setDuration(kParticleDurationInfinity);
+ _emitter->setDuration(ParticleSystem::DURATION_INFINITY);
// radius mode
- _emitter->setEmitterMode(kParticleModeRadius);
+ _emitter->setEmitterMode(ParticleSystem::Mode::RADIUS);
// radius mode: start and end radius in pixels
_emitter->setStartRadius(0);
@@ -701,7 +695,7 @@ void RadiusMode1::onEnter()
// size, in pixels
_emitter->setStartSize(32);
_emitter->setStartSizeVar(0);
- _emitter->setEndSize(kParticleStartSizeEqualToEndSize);
+ _emitter->setEndSize(ParticleSystem::START_SIZE_EQUAL_TO_END_SIZE);
// emits per second
_emitter->setEmissionRate(_emitter->getTotalParticles() / _emitter->getLife());
@@ -734,15 +728,15 @@ void RadiusMode2::onEnter()
_emitter->setTexture(TextureCache::getInstance()->addImage("Images/stars-grayscale.png"));
// duration
- _emitter->setDuration(kParticleDurationInfinity);
+ _emitter->setDuration(ParticleSystem::DURATION_INFINITY);
// radius mode
- _emitter->setEmitterMode(kParticleModeRadius);
+ _emitter->setEmitterMode(ParticleSystem::Mode::RADIUS);
// radius mode: start and end radius in pixels
_emitter->setStartRadius(100);
_emitter->setStartRadiusVar(0);
- _emitter->setEndRadius(kParticleStartRadiusEqualToEndRadius);
+ _emitter->setEndRadius(ParticleSystem::START_RADIUS_EQUAL_TO_END_RADIUS);
_emitter->setEndRadiusVar(0);
// radius mode: degrees per second
@@ -785,7 +779,7 @@ void RadiusMode2::onEnter()
// size, in pixels
_emitter->setStartSize(32);
_emitter->setStartSizeVar(0);
- _emitter->setEndSize(kParticleStartSizeEqualToEndSize);
+ _emitter->setEndSize(ParticleSystem::START_SIZE_EQUAL_TO_END_SIZE);
// emits per second
_emitter->setEmissionRate(_emitter->getTotalParticles() / _emitter->getLife());
@@ -818,15 +812,15 @@ void Issue704::onEnter()
_emitter->setTexture(TextureCache::getInstance()->addImage("Images/fire.png"));
// duration
- _emitter->setDuration(kParticleDurationInfinity);
+ _emitter->setDuration(ParticleSystem::DURATION_INFINITY);
// radius mode
- _emitter->setEmitterMode(kParticleModeRadius);
+ _emitter->setEmitterMode(ParticleSystem::Mode::RADIUS);
// radius mode: start and end radius in pixels
_emitter->setStartRadius(50);
_emitter->setStartRadiusVar(0);
- _emitter->setEndRadius(kParticleStartRadiusEqualToEndRadius);
+ _emitter->setEndRadius(ParticleSystem::START_RADIUS_EQUAL_TO_END_RADIUS);
_emitter->setEndRadiusVar(0);
// radius mode: degrees per second
@@ -869,7 +863,7 @@ void Issue704::onEnter()
// size, in pixels
_emitter->setStartSize(16);
_emitter->setStartSizeVar(0);
- _emitter->setEndSize(kParticleStartSizeEqualToEndSize);
+ _emitter->setEndSize(ParticleSystem::START_SIZE_EQUAL_TO_END_SIZE);
// emits per second
_emitter->setEmissionRate(_emitter->getTotalParticles() / _emitter->getLife());
@@ -1120,19 +1114,19 @@ std::string ParticleDemo::subtitle()
return "No titile";
}
-void ParticleDemo::ccTouchesBegan(Set *pTouches, Event *pEvent)
+void ParticleDemo::ccTouchesBegan(Set *touches, Event *event)
{
- ccTouchesEnded(pTouches, pEvent);
+ ccTouchesEnded(touches, event);
}
-void ParticleDemo::ccTouchesMoved(Set *pTouches, Event *pEvent)
+void ParticleDemo::ccTouchesMoved(Set *touches, Event *event)
{
- return ccTouchesEnded(pTouches, pEvent);
+ return ccTouchesEnded(touches, event);
}
-void ParticleDemo::ccTouchesEnded(Set *pTouches, Event *pEvent)
+void ParticleDemo::ccTouchesEnded(Set *touches, Event *event)
{
- Touch *touch = (Touch*)pTouches->anyObject();
+ Touch *touch = static_cast(touches->anyObject());
Point location = touch->getLocation();
@@ -1159,20 +1153,20 @@ void ParticleDemo::update(float dt)
}
}
-void ParticleDemo::toggleCallback(Object* pSender)
+void ParticleDemo::toggleCallback(Object* sender)
{
if (_emitter != NULL)
{
- if( _emitter->getPositionType() == kPositionTypeGrouped )
- _emitter->setPositionType( kPositionTypeFree );
- else if (_emitter->getPositionType() == kPositionTypeFree)
- _emitter->setPositionType(kPositionTypeRelative);
- else if (_emitter->getPositionType() == kPositionTypeRelative)
- _emitter->setPositionType( kPositionTypeGrouped );
+ if (_emitter->getPositionType() == ParticleSystem::PositionType::GROUPED)
+ _emitter->setPositionType(ParticleSystem::PositionType::FREE);
+ else if (_emitter->getPositionType() == ParticleSystem::PositionType::FREE)
+ _emitter->setPositionType(ParticleSystem::PositionType::RELATIVE);
+ else if (_emitter->getPositionType() == ParticleSystem::PositionType::RELATIVE)
+ _emitter->setPositionType(ParticleSystem::PositionType::GROUPED );
}
}
-void ParticleDemo::restartCallback(Object* pSender)
+void ParticleDemo::restartCallback(Object* sender)
{
if (_emitter != NULL)
{
@@ -1180,7 +1174,7 @@ void ParticleDemo::restartCallback(Object* pSender)
}
}
-void ParticleDemo::nextCallback(Object* pSender)
+void ParticleDemo::nextCallback(Object* sender)
{
Scene* s = new ParticleTestScene();
s->addChild( nextParticleAction() );
@@ -1188,7 +1182,7 @@ void ParticleDemo::nextCallback(Object* pSender)
s->release();
}
-void ParticleDemo::backCallback(Object* pSender)
+void ParticleDemo::backCallback(Object* sender)
{
Scene* s = new ParticleTestScene();
s->addChild( backParticleAction() );
@@ -1403,10 +1397,10 @@ bool RainbowEffect::initWithTotalParticles(unsigned int numberOfParticles)
setBlendAdditive(false);
// duration
- setDuration(kParticleDurationInfinity);
+ setDuration(ParticleSystem::DURATION_INFINITY);
// Gravity Mode
- setEmitterMode(kParticleModeGravity);
+ setEmitterMode(ParticleSystem::Mode::GRAVITY);
// Gravity Mode: gravity
setGravity(Point(0,0));
@@ -1436,7 +1430,7 @@ bool RainbowEffect::initWithTotalParticles(unsigned int numberOfParticles)
// size, in pixels
setStartSize(25.0f);
setStartSizeVar(0);
- setEndSize(kParticleStartSizeEqualToEndSize);
+ setEndSize(ParticleSystem::START_SIZE_EQUAL_TO_END_SIZE);
// emits per seconds
setEmissionRate(getTotalParticles()/getLife());
@@ -1513,7 +1507,7 @@ void MultipleParticleSystems::onEnter()
particleSystem->setPosition(Point(i*50 ,i*50));
- particleSystem->setPositionType(kPositionTypeGrouped);
+ particleSystem->setPositionType(ParticleSystem::PositionType::GROUPED);
addChild(particleSystem);
}
@@ -1570,7 +1564,7 @@ void MultipleParticleSystemsBatched::onEnter()
ParticleSystemQuad *particleSystem = ParticleSystemQuad::create("Particles/SpinningPeas.plist");
- particleSystem->setPositionType(kPositionTypeGrouped);
+ particleSystem->setPositionType(ParticleSystem::PositionType::GROUPED);
particleSystem->setPosition(Point(i*50 ,i*50));
batchNode->setTexture(particleSystem->getTexture());
@@ -1633,7 +1627,7 @@ void AddAndDeleteParticleSystems::onEnter()
ParticleSystemQuad *particleSystem = ParticleSystemQuad::create("Particles/Spiral.plist");
_batchNode->setTexture(particleSystem->getTexture());
- particleSystem->setPositionType(kPositionTypeGrouped);
+ particleSystem->setPositionType(ParticleSystem::PositionType::GROUPED);
particleSystem->setTotalParticles(200);
particleSystem->setPosition(Point(i*15 +100,i*15+100));
@@ -1660,7 +1654,7 @@ void AddAndDeleteParticleSystems::removeSystem(float dt)
ParticleSystemQuad *particleSystem = ParticleSystemQuad::create("Particles/Spiral.plist");
//add new
- particleSystem->setPositionType(kPositionTypeGrouped);
+ particleSystem->setPositionType(ParticleSystem::PositionType::GROUPED);
particleSystem->setTotalParticles(200);
particleSystem->setPosition(Point(rand() % 300 ,rand() % 400));
@@ -1724,15 +1718,15 @@ void ReorderParticleSystems::onEnter()
particleSystem->setTexture(_batchNode->getTexture());
// duration
- particleSystem->setDuration(kParticleDurationInfinity);
+ particleSystem->setDuration(ParticleSystem::DURATION_INFINITY);
// radius mode
- particleSystem->setEmitterMode(kParticleModeRadius);
+ particleSystem->setEmitterMode(ParticleSystem::Mode::RADIUS);
// radius mode: 100 pixels from center
particleSystem->setStartRadius(100);
particleSystem->setStartRadiusVar(0);
- particleSystem->setEndRadius(kParticleStartRadiusEqualToEndRadius);
+ particleSystem->setEndRadius(ParticleSystem::START_RADIUS_EQUAL_TO_END_RADIUS);
particleSystem->setEndRadiusVar(0); // not used when start == end
// radius mode: degrees per second
@@ -1776,7 +1770,7 @@ void ReorderParticleSystems::onEnter()
// size, in pixels
particleSystem->setStartSize(32);
particleSystem->setStartSizeVar(0);
- particleSystem->setEndSize(kParticleStartSizeEqualToEndSize);
+ particleSystem->setEndSize(ParticleSystem::START_SIZE_EQUAL_TO_END_SIZE);
// emits per second
particleSystem->setEmissionRate(particleSystem->getTotalParticles()/particleSystem->getLife());
@@ -1787,7 +1781,7 @@ void ReorderParticleSystems::onEnter()
_batchNode->addChild(particleSystem);
- particleSystem->setPositionType(kPositionTypeFree);
+ particleSystem->setPositionType(ParticleSystem::PositionType::FREE);
particleSystem->release();
@@ -1864,8 +1858,7 @@ void PremultipliedAlphaTest::onEnter()
//this->emitter.blendFunc = (BlendFunc){ GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA };
// Cocos2d "normal" blend func for premul causes alpha to be ignored (oversaturates colors)
- BlendFunc tBlendFunc = { GL_ONE, GL_ONE_MINUS_SRC_ALPHA };
- _emitter->setBlendFunc(tBlendFunc);
+ _emitter->setBlendFunc( BlendFunc::ALPHA_PREMULTIPLIED );
CCASSERT(_emitter->isOpacityModifyRGB(), "Particle texture does not have premultiplied alpha, test is useless");
diff --git a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.h b/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.h
index b95730891c..65e6478d5a 100644
--- a/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.h
+++ b/samples/Cpp/TestCpp/Classes/ParticleTest/ParticleTest.h
@@ -28,14 +28,14 @@ public:
virtual std::string title();
virtual std::string subtitle();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
- void toggleCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
+ void toggleCallback(Object* sender);
- virtual void ccTouchesBegan(Set *pTouches, Event *pEvent);
- virtual void ccTouchesMoved(Set *pTouches, Event *pEvent);
- virtual void ccTouchesEnded(Set *pTouches, Event *pEvent);
+ virtual void ccTouchesBegan(Set *touches, Event *event);
+ virtual void ccTouchesMoved(Set *touches, Event *event);
+ virtual void ccTouchesEnded(Set *touches, Event *event);
virtual void update(float dt);
void setEmitterPosition();
diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp
index a70b5c1d08..d2670f69d6 100644
--- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.cpp
@@ -202,17 +202,17 @@ void ParticleMainScene::createParticleSystem()
switch( subtestNumber)
{
case 1:
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA8888);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888);
particleSystem->initWithTotalParticles(quantityParticles);
particleSystem->setTexture(TextureCache::getInstance()->addImage("Images/fire.png"));
break;
case 2:
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA4444);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA4444);
particleSystem->initWithTotalParticles(quantityParticles);
particleSystem->setTexture(TextureCache::getInstance()->addImage("Images/fire.png"));
break;
case 3:
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_A8);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::A8);
particleSystem->initWithTotalParticles(quantityParticles);
particleSystem->setTexture(TextureCache::getInstance()->addImage("Images/fire.png"));
break;
@@ -222,17 +222,17 @@ void ParticleMainScene::createParticleSystem()
// particleSystem->setTexture(TextureCache::getInstance()->addImage("Images/fire.png"));
// break;
case 4:
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA8888);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888);
particleSystem->initWithTotalParticles(quantityParticles);
particleSystem->setTexture(TextureCache::getInstance()->addImage("Images/fire.png"));
break;
case 5:
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA4444);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA4444);
particleSystem->initWithTotalParticles(quantityParticles);
particleSystem->setTexture(TextureCache::getInstance()->addImage("Images/fire.png"));
break;
case 6:
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_A8);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::A8);
particleSystem->initWithTotalParticles(quantityParticles);
particleSystem->setTexture(TextureCache::getInstance()->addImage("Images/fire.png"));
break;
@@ -252,15 +252,15 @@ void ParticleMainScene::createParticleSystem()
doTest();
// restore the default pixel format
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA8888);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888);
}
-void ParticleMainScene::testNCallback(Object* pSender)
+void ParticleMainScene::testNCallback(Object* sender)
{
- subtestNumber = ((Node*)pSender)->getTag();
+ subtestNumber = static_cast(sender)->getTag();
- ParticleMenuLayer* menu = (ParticleMenuLayer*)getChildByTag(kTagMenuLayer);
- menu->restartCallback(pSender);
+ auto menu = static_cast( getChildByTag(kTagMenuLayer) );
+ menu->restartCallback(sender);
}
void ParticleMainScene::updateQuantityLabel()
diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.h b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.h
index 6dad0146f0..2412ba975f 100644
--- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.h
+++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceParticleTest.h
@@ -18,7 +18,7 @@ public:
void step(float dt);
void createParticleSystem();
- void testNCallback(Object* pSender);
+ void testNCallback(Object* sender);
void updateQuantityLabel();
int getSubTestNum() { return subtestNumber; }
int getParticlesNum() { return quantityParticles; }
diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp
index 1777c1aa72..8fc2774af8 100644
--- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp
@@ -67,36 +67,36 @@ void SubTest::initWithSubTest(int nSubTest, Node* p)
break;
///
case 2:
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA8888);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888);
batchNode = SpriteBatchNode::create("Images/grossinis_sister1.png", 100);
p->addChild(batchNode, 0);
break;
case 3:
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA4444);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA4444);
batchNode = SpriteBatchNode::create("Images/grossinis_sister1.png", 100);
p->addChild(batchNode, 0);
break;
///
case 5:
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA8888);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888);
batchNode = SpriteBatchNode::create("Images/grossini_dance_atlas.png", 100);
p->addChild(batchNode, 0);
break;
case 6:
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA4444);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA4444);
batchNode = SpriteBatchNode::create("Images/grossini_dance_atlas.png", 100);
p->addChild(batchNode, 0);
break;
///
case 8:
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA8888);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888);
batchNode = SpriteBatchNode::create("Images/spritesheet1.png", 100);
p->addChild(batchNode, 0);
break;
case 9:
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA4444);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA4444);
batchNode = SpriteBatchNode::create("Images/spritesheet1.png", 100);
p->addChild(batchNode, 0);
break;
@@ -110,13 +110,13 @@ void SubTest::initWithSubTest(int nSubTest, Node* p)
batchNode->retain();
}
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_Default);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::DEFAULT);
}
Sprite* SubTest::createSpriteWithTag(int tag)
{
// create
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA8888);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888);
Sprite* sprite = NULL;
switch (subtestNumber)
@@ -194,7 +194,7 @@ Sprite* SubTest::createSpriteWithTag(int tag)
break;
}
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_Default);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::DEFAULT);
return sprite;
}
@@ -354,11 +354,11 @@ SpriteMainScene::~SpriteMainScene()
}
}
-void SpriteMainScene::testNCallback(Object* pSender)
+void SpriteMainScene::testNCallback(Object* sender)
{
- subtestNumber = ((MenuItemFont*) pSender)->getTag();
- SpriteMenuLayer* menu = (SpriteMenuLayer*)getChildByTag(kTagMenuLayer);
- menu->restartCallback(pSender);
+ subtestNumber = static_cast(sender)->getTag();
+ auto menu = static_cast( getChildByTag(kTagMenuLayer) );
+ menu->restartCallback(sender);
}
void SpriteMainScene::updateNodes()
@@ -374,7 +374,7 @@ void SpriteMainScene::updateNodes()
}
}
-void SpriteMainScene::onIncrease(Object* pSender)
+void SpriteMainScene::onIncrease(Object* sender)
{
if( quantityNodes >= kMaxNodes)
return;
@@ -389,7 +389,7 @@ void SpriteMainScene::onIncrease(Object* pSender)
updateNodes();
}
-void SpriteMainScene::onDecrease(Object* pSender)
+void SpriteMainScene::onDecrease(Object* sender)
{
if( quantityNodes <= 0 )
return;
diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.h b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.h
index 9fd16220dc..da7f009ec3 100644
--- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.h
+++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.h
@@ -37,9 +37,9 @@ public:
void initWithSubTest(int nSubTest, int nNodes);
void updateNodes();
- void testNCallback(Object* pSender);
- void onIncrease(Object* pSender);
- void onDecrease(Object* pSender);
+ void testNCallback(Object* sender);
+ void onIncrease(Object* sender);
+ void onDecrease(Object* sender);
virtual void doTest(Sprite* sprite) = 0;
diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.cpp
index 4f852ad552..6321671805 100644
--- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.cpp
@@ -91,7 +91,7 @@ void PerformBasicLayer::onEnter()
addChild(menu);
}
-void PerformBasicLayer::toMainLayer(Object* pSender)
+void PerformBasicLayer::toMainLayer(Object* sender)
{
PerformanceTestScene* scene = new PerformanceTestScene();
scene->runThisTest();
@@ -99,12 +99,12 @@ void PerformBasicLayer::toMainLayer(Object* pSender)
scene->release();
}
-void PerformBasicLayer::restartCallback(Object* pSender)
+void PerformBasicLayer::restartCallback(Object* sender)
{
showCurrentTest();
}
-void PerformBasicLayer::nextCallback(Object* pSender)
+void PerformBasicLayer::nextCallback(Object* sender)
{
_curCase++;
_curCase = _curCase % _maxCases;
@@ -112,7 +112,7 @@ void PerformBasicLayer::nextCallback(Object* pSender)
showCurrentTest();
}
-void PerformBasicLayer::backCallback(Object* pSender)
+void PerformBasicLayer::backCallback(Object* sender)
{
_curCase--;
if( _curCase < 0 )
diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.h b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.h
index 844c148595..95f0d38464 100644
--- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.h
+++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTest.h
@@ -16,12 +16,12 @@ public:
virtual void onEnter();
- virtual void restartCallback(Object* pSender);
- virtual void nextCallback(Object* pSender);
- virtual void backCallback(Object* pSender);
+ virtual void restartCallback(Object* sender);
+ virtual void nextCallback(Object* sender);
+ virtual void backCallback(Object* sender);
virtual void showCurrentTest() = 0;
- virtual void toMainLayer(Object* pSender);
+ virtual void toMainLayer(Object* sender);
protected:
bool _controlMenuVisible;
diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.cpp b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.cpp
index 3abf1fb776..6a0e7a6aee 100644
--- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceTextureTest.cpp
@@ -87,7 +87,7 @@ void TextureTest::performTestsPNG(const char* filename)
TextureCache *cache = TextureCache::getInstance();
log("RGBA 8888");
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA8888);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888);
gettimeofday(&now, NULL);
texture = cache->addImage(filename);
if( texture )
@@ -97,7 +97,7 @@ void TextureTest::performTestsPNG(const char* filename)
cache->removeTexture(texture);
log("RGBA 4444");
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA4444);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA4444);
gettimeofday(&now, NULL);
texture = cache->addImage(filename);
if( texture )
@@ -107,7 +107,7 @@ void TextureTest::performTestsPNG(const char* filename)
cache->removeTexture(texture);
log("RGBA 5551");
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGB5A1);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGB5A1);
gettimeofday(&now, NULL);
texture = cache->addImage(filename);
if( texture )
@@ -117,7 +117,7 @@ void TextureTest::performTestsPNG(const char* filename)
cache->removeTexture(texture);
log("RGB 565");
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGB565);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGB565);
gettimeofday(&now, NULL);
texture = cache->addImage(filename);
if( texture )
diff --git a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp
index 0c9743b3b6..8c93958856 100644
--- a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp
@@ -55,7 +55,7 @@ void RenderTextureTest::onEnter()
BaseTest::onEnter();
}
-void RenderTextureTest::restartCallback(Object* pSender)
+void RenderTextureTest::restartCallback(Object* sender)
{
Scene* s = new RenderTextureScene();
s->addChild(restartTestCase());
@@ -64,7 +64,7 @@ void RenderTextureTest::restartCallback(Object* pSender)
s->release();
}
-void RenderTextureTest::nextCallback(Object* pSender)
+void RenderTextureTest::nextCallback(Object* sender)
{
Scene* s = new RenderTextureScene();
s->addChild( nextTestCase() );
@@ -72,7 +72,7 @@ void RenderTextureTest::nextCallback(Object* pSender)
s->release();
}
-void RenderTextureTest::backCallback(Object* pSender)
+void RenderTextureTest::backCallback(Object* sender)
{
Scene* s = new RenderTextureScene();
s->addChild( backTestCase() );
@@ -98,7 +98,7 @@ RenderTextureSave::RenderTextureSave()
Size s = Director::getInstance()->getWinSize();
// create a render texture, this is what we are going to draw into
- _target = RenderTexture::create(s.width, s.height, kTexture2DPixelFormat_RGBA8888);
+ _target = RenderTexture::create(s.width, s.height, Texture2D::PixelFormat::RGBA8888);
_target->retain();
_target->setPosition(Point(s.width / 2, s.height / 2));
@@ -147,8 +147,8 @@ void RenderTextureSave::saveImage(cocos2d::Object *pSender)
char jpg[20];
sprintf(jpg, "image-%d.jpg", counter);
- _target->saveToFile(png, kImageFormatPNG);
- _target->saveToFile(jpg, kImageFormatJPEG);
+ _target->saveToFile(png, Image::Format::PNG);
+ _target->saveToFile(jpg, Image::Format::JPG);
Image *pImage = _target->newImage();
@@ -243,7 +243,7 @@ RenderTextureIssue937::RenderTextureIssue937()
/* A2 & B2 setup */
- RenderTexture *rend = RenderTexture::create(32, 64, kTexture2DPixelFormat_RGBA8888);
+ RenderTexture *rend = RenderTexture::create(32, 64, Texture2D::PixelFormat::RGBA8888);
if (NULL == rend)
{
@@ -441,7 +441,7 @@ RenderTextureTestDepthStencil::RenderTextureTestDepthStencil()
Sprite *sprite = Sprite::create("Images/fire.png");
sprite->setPosition(Point(s.width * 0.25f, 0));
sprite->setScale(10);
- RenderTexture *rend = RenderTexture::create(s.width, s.height, kTexture2DPixelFormat_RGBA4444, GL_DEPTH24_STENCIL8);
+ RenderTexture *rend = RenderTexture::create(s.width, s.height, Texture2D::PixelFormat::RGBA4444, GL_DEPTH24_STENCIL8);
glStencilMask(0xFF);
rend->beginWithClear(0, 0, 0, 0, 0, 0);
@@ -505,7 +505,7 @@ RenderTextureTargetNode::RenderTextureTargetNode()
Size s = Director::getInstance()->getWinSize();
/* Create the render texture */
- RenderTexture *renderTexture = RenderTexture::create(s.width, s.height, kTexture2DPixelFormat_RGBA4444);
+ RenderTexture *renderTexture = RenderTexture::create(s.width, s.height, Texture2D::PixelFormat::RGBA4444);
this->renderTexture = renderTexture;
renderTexture->setPosition(Point(s.width/2, s.height/2));
@@ -591,7 +591,7 @@ void SpriteRenderTextureBug::SimpleSprite::draw()
{
Size s = Director::getInstance()->getWinSize();
rt = new RenderTexture();
- rt->initWithWidthAndHeight(s.width, s.height, kTexture2DPixelFormat_RGBA8888);
+ rt->initWithWidthAndHeight(s.width, s.height, Texture2D::PixelFormat::RGBA8888);
}
rt->beginWithClear(0.0f, 0.0f, 0.0f, 1.0f);
rt->end();
@@ -599,30 +599,30 @@ void SpriteRenderTextureBug::SimpleSprite::draw()
CC_NODE_DRAW_SETUP();
BlendFunc blend = getBlendFunc();
- ccGLBlendFunc(blend.src, blend.dst);
+ GL::blendFunc(blend.src, blend.dst);
- ccGLBindTexture2D(getTexture()->getName());
+ GL::bindTexture2D(getTexture()->getName());
//
// Attributes
//
- ccGLEnableVertexAttribs(kVertexAttribFlag_PosColorTex);
+ GL::enableVertexAttribs(cocos2d::GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX);
#define kQuadSize sizeof(_quad.bl)
long offset = (long)&_quad;
// vertex
int diff = offsetof( V3F_C4B_T2F, vertices);
- glVertexAttribPointer(kVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, kQuadSize, (void*) (offset + diff));
+ glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, kQuadSize, (void*) (offset + diff));
// texCoods
diff = offsetof( V3F_C4B_T2F, texCoords);
- glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (void*)(offset + diff));
+ glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, kQuadSize, (void*)(offset + diff));
// color
diff = offsetof( V3F_C4B_T2F, colors);
- glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (void*)(offset + diff));
+ glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (void*)(offset + diff));
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
diff --git a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h
index e220be3289..e0a3b891dd 100644
--- a/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h
+++ b/samples/Cpp/TestCpp/Classes/RenderTextureTest/RenderTextureTest.h
@@ -12,9 +12,9 @@ public:
virtual std::string title();
virtual std::string subtitle();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
};
class RenderTextureSave : public RenderTextureTest
diff --git a/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.cpp b/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.cpp
index 018f9ec325..4c175f8ede 100644
--- a/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.cpp
@@ -60,7 +60,7 @@ SceneTestLayer1::~SceneTestLayer1()
//NSLog(@"SceneTestLayer1 - dealloc");
}
-void SceneTestLayer1::onPushScene(Object* pSender)
+void SceneTestLayer1::onPushScene(Object* sender)
{
Scene* scene = new SceneTestScene();
Layer* layer = new SceneTestLayer2();
@@ -70,7 +70,7 @@ void SceneTestLayer1::onPushScene(Object* pSender)
layer->release();
}
-void SceneTestLayer1::onPushSceneTran(Object* pSender)
+void SceneTestLayer1::onPushSceneTran(Object* sender)
{
Scene* scene = new SceneTestScene();
Layer* layer = new SceneTestLayer2();
@@ -82,7 +82,7 @@ void SceneTestLayer1::onPushSceneTran(Object* pSender)
}
-void SceneTestLayer1::onQuit(Object* pSender)
+void SceneTestLayer1::onQuit(Object* sender)
{
//getCocosApp()->exit();
//CCDirector::getInstance()->poscene();
@@ -130,12 +130,12 @@ void SceneTestLayer2::testDealloc(float dt)
// onReplaceScene(this);
}
-void SceneTestLayer2::onGoBack(Object* pSender)
+void SceneTestLayer2::onGoBack(Object* sender)
{
Director::getInstance()->popScene();
}
-void SceneTestLayer2::onReplaceScene(Object* pSender)
+void SceneTestLayer2::onReplaceScene(Object* sender)
{
Scene* scene = new SceneTestScene();
Layer* layer = SceneTestLayer3::create();
@@ -145,7 +145,7 @@ void SceneTestLayer2::onReplaceScene(Object* pSender)
}
-void SceneTestLayer2::onReplaceSceneTran(Object* pSender)
+void SceneTestLayer2::onReplaceSceneTran(Object* sender)
{
Scene* scene = new SceneTestScene();
Layer* layer = SceneTestLayer3::create();
@@ -198,24 +198,24 @@ void SceneTestLayer3::testDealloc(float dt)
log("Layer3:testDealloc");
}
-void SceneTestLayer3::item0Clicked(Object* pSender)
+void SceneTestLayer3::item0Clicked(Object* sender)
{
Scene *newScene = Scene::create();
newScene->addChild(SceneTestLayer3::create());
Director::getInstance()->pushScene(TransitionFade::create(0.5, newScene, Color3B(0,255,255)));
}
-void SceneTestLayer3::item1Clicked(Object* pSender)
+void SceneTestLayer3::item1Clicked(Object* sender)
{
Director::getInstance()->popScene();
}
-void SceneTestLayer3::item2Clicked(Object* pSender)
+void SceneTestLayer3::item2Clicked(Object* sender)
{
Director::getInstance()->popToRootScene();
}
-void SceneTestLayer3::item3Clicked(Object* pSender)
+void SceneTestLayer3::item3Clicked(Object* sender)
{
Director::getInstance()->popToSceneStackLevel(2);
}
diff --git a/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.h b/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.h
index ba6302e8fc..b79ff0a656 100644
--- a/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.h
+++ b/samples/Cpp/TestCpp/Classes/SceneTest/SceneTest.h
@@ -14,9 +14,9 @@ public:
virtual void onEnterTransitionDidFinish();
void testDealloc(float dt);
- void onPushScene(Object* pSender);
- void onPushSceneTran(Object* pSender);
- void onQuit(Object* pSender);
+ void onPushScene(Object* sender);
+ void onPushSceneTran(Object* sender);
+ void onQuit(Object* sender);
//CREATE_NODE(SceneTestLayer1);
} ;
@@ -28,9 +28,9 @@ public:
SceneTestLayer2();
void testDealloc(float dt);
- void onGoBack(Object* pSender);
- void onReplaceScene(Object* pSender);
- void onReplaceSceneTran(Object* pSender);
+ void onGoBack(Object* sender);
+ void onReplaceScene(Object* sender);
+ void onReplaceSceneTran(Object* sender);
//CREATE_NODE(SceneTestLayer2);
} ;
@@ -41,10 +41,10 @@ public:
SceneTestLayer3();
bool init();
virtual void testDealloc(float dt);
- void item0Clicked(Object* pSender);
- void item1Clicked(Object* pSender);
- void item2Clicked(Object* pSender);
- void item3Clicked(Object* pSender);
+ void item0Clicked(Object* sender);
+ void item1Clicked(Object* sender);
+ void item2Clicked(Object* sender);
+ void item3Clicked(Object* sender);
CREATE_FUNC(SceneTestLayer3)
} ;
diff --git a/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp b/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp
index b4d8cc5de6..6244072167 100644
--- a/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp
@@ -94,7 +94,7 @@ void SchedulerTestLayer::onEnter()
BaseTest::onEnter();
}
-void SchedulerTestLayer::backCallback(Object* pSender)
+void SchedulerTestLayer::backCallback(Object* sender)
{
Scene* scene = new SchedulerTestScene();
Layer* layer = backSchedulerTest();
@@ -104,7 +104,7 @@ void SchedulerTestLayer::backCallback(Object* pSender)
scene->release();
}
-void SchedulerTestLayer::nextCallback(Object* pSender)
+void SchedulerTestLayer::nextCallback(Object* sender)
{
Scene* scene = new SchedulerTestScene();
Layer* layer = nextSchedulerTest();
@@ -114,7 +114,7 @@ void SchedulerTestLayer::nextCallback(Object* pSender)
scene->release();
}
-void SchedulerTestLayer::restartCallback(Object* pSender)
+void SchedulerTestLayer::restartCallback(Object* sender)
{
Scene* scene = new SchedulerTestScene();
Layer* layer = restartSchedulerTest();
@@ -359,7 +359,7 @@ void SchedulerPauseResumeAllUser::pause(float dt)
{
log("Pausing");
Director* director = Director::getInstance();
- _pausedTargets = director->getScheduler()->pauseAllTargetsWithMinPriority(kPriorityNonSystemMin);
+ _pausedTargets = director->getScheduler()->pauseAllTargetsWithMinPriority(Scheduler::PRIORITY_NON_SYSTEM_MIN);
CC_SAFE_RETAIN(_pausedTargets);
}
@@ -463,7 +463,7 @@ void SchedulerUnscheduleAllHard::onExit()
if(!_actionManagerActive) {
// Restore the director's action manager.
Director* director = Director::getInstance();
- director->getScheduler()->scheduleUpdateForTarget(director->getActionManager(), kPrioritySystem, false);
+ director->getScheduler()->scheduleUpdateForTarget(director->getActionManager(), Scheduler::PRIORITY_SYSTEM, false);
}
}
@@ -548,7 +548,7 @@ void SchedulerUnscheduleAllUserLevel::tick4(float dt)
void SchedulerUnscheduleAllUserLevel::unscheduleAll(float dt)
{
- Director::getInstance()->getScheduler()->unscheduleAllWithMinPriority(kPriorityNonSystemMin);
+ Director::getInstance()->getScheduler()->unscheduleAllWithMinPriority(Scheduler::PRIORITY_NON_SYSTEM_MIN);
}
std::string SchedulerUnscheduleAllUserLevel::title()
@@ -874,9 +874,9 @@ ControlSlider* SchedulerTimeScale::sliderCtl()
return slider;
}
-void SchedulerTimeScale::sliderAction(Object* pSender, ControlEvent controlEvent)
+void SchedulerTimeScale::sliderAction(Object* sender, ControlEvent controlEvent)
{
- ControlSlider* pSliderCtl = static_cast(pSender);
+ ControlSlider* pSliderCtl = static_cast(sender);
float scale;
scale = pSliderCtl->getValue();
diff --git a/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h b/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h
index 464ffff35a..34ea78d2bf 100644
--- a/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h
+++ b/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h
@@ -16,9 +16,9 @@ public:
virtual std::string title();
virtual std::string subtitle();
- void backCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void restartCallback(Object* pSender);
+ void backCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void restartCallback(Object* sender);
};
// class SchedulerTestLayer : Layer
@@ -228,7 +228,7 @@ public:
virtual std::string title();
virtual std::string subtitle();
ControlSlider* sliderCtl();
- void sliderAction(Object* pSender, ControlEvent controlEvent);
+ void sliderAction(Object* sender, ControlEvent controlEvent);
ControlSlider* _sliderCtl;
};
diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp
index f5cd6d9ad0..55cd368e61 100644
--- a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.cpp
@@ -62,7 +62,7 @@ ShaderTestDemo::ShaderTestDemo()
}
-void ShaderTestDemo::backCallback(Object* pSender)
+void ShaderTestDemo::backCallback(Object* sender)
{
Scene* s = new ShaderTestScene();
s->addChild( backAction() );
@@ -70,7 +70,7 @@ void ShaderTestDemo::backCallback(Object* pSender)
s->release();
}
-void ShaderTestDemo::nextCallback(Object* pSender)
+void ShaderTestDemo::nextCallback(Object* sender)
{
Scene* s = new ShaderTestScene();//CCScene::create();
s->addChild( nextAction() );
@@ -88,7 +88,7 @@ std::string ShaderTestDemo::subtitle()
return "";
}
-void ShaderTestDemo::restartCallback(Object* pSender)
+void ShaderTestDemo::restartCallback(Object* sender)
{
Scene* s = new ShaderTestScene();
s->addChild(restartAction());
@@ -166,7 +166,7 @@ void ShaderNode::loadShaderVertex(const char *vert, const char *frag)
GLProgram *shader = new GLProgram();
shader->initWithVertexShaderFilename(vert, frag);
- shader->addAttribute("aVertex", kVertexAttrib_Position);
+ shader->addAttribute("aVertex", GLProgram::VERTEX_ATTRIB_POSITION);
shader->link();
shader->updateUniforms();
@@ -208,9 +208,9 @@ void ShaderNode::draw()
// time changes all the time, so it is Ok to call OpenGL directly, and not the "cached" version
glUniform1f(_uniformTime, _time);
- ccGLEnableVertexAttribs( kVertexAttribFlag_Position );
+ GL::enableVertexAttribs( cocos2d::GL::VERTEX_ATTRIB_FLAG_POSITION );
- glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices);
+ glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);
glDrawArrays(GL_TRIANGLES, 0, 6);
@@ -499,9 +499,9 @@ void SpriteBlur::initProgram()
CHECK_GL_ERROR_DEBUG();
- getShaderProgram()->addAttribute(kAttributeNamePosition, kVertexAttrib_Position);
- getShaderProgram()->addAttribute(kAttributeNameColor, kVertexAttrib_Color);
- getShaderProgram()->addAttribute(kAttributeNameTexCoord, kVertexAttrib_TexCoords);
+ getShaderProgram()->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);
+ getShaderProgram()->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR);
+ getShaderProgram()->addAttribute(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);
CHECK_GL_ERROR_DEBUG();
@@ -521,16 +521,16 @@ void SpriteBlur::initProgram()
void SpriteBlur::draw()
{
- ccGLEnableVertexAttribs(kVertexAttribFlag_PosColorTex );
+ GL::enableVertexAttribs(cocos2d::GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX );
BlendFunc blend = getBlendFunc();
- ccGLBlendFunc(blend.src, blend.dst);
+ GL::blendFunc(blend.src, blend.dst);
getShaderProgram()->use();
getShaderProgram()->setUniformsForBuiltins();
getShaderProgram()->setUniformLocationWith2f(blurLocation, blur_.x, blur_.y);
getShaderProgram()->setUniformLocationWith4fv(subLocation, sub_, 1);
- ccGLBindTexture2D( getTexture()->getName());
+ GL::bindTexture2D( getTexture()->getName());
//
// Attributes
@@ -540,15 +540,15 @@ void SpriteBlur::draw()
// vertex
int diff = offsetof( V3F_C4B_T2F, vertices);
- glVertexAttribPointer(kVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, kQuadSize, (void*) (offset + diff));
+ glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, kQuadSize, (void*) (offset + diff));
// texCoods
diff = offsetof( V3F_C4B_T2F, texCoords);
- glVertexAttribPointer(kVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (void*)(offset + diff));
+ glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, kQuadSize, (void*)(offset + diff));
// color
diff = offsetof( V3F_C4B_T2F, colors);
- glVertexAttribPointer(kVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (void*)(offset + diff));
+ glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (void*)(offset + diff));
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
@@ -646,8 +646,8 @@ bool ShaderRetroEffect::init()
GLProgram *p = new GLProgram();
p->initWithVertexShaderByteArray(ccPositionTexture_vert, fragSource);
- p->addAttribute(kAttributeNamePosition, kVertexAttrib_Position);
- p->addAttribute(kAttributeNameTexCoord, kVertexAttrib_TexCoords);
+ p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);
+ p->addAttribute(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);
p->link();
p->updateUniforms();
@@ -740,8 +740,8 @@ ShaderFail::ShaderFail()
GLProgram *p = new GLProgram();
p->initWithVertexShaderByteArray(ccPositionTexture_vert, shader_frag_fail);
- p->addAttribute(kAttributeNamePosition, kVertexAttrib_Position);
- p->addAttribute(kAttributeNameTexCoord, kVertexAttrib_TexCoords);
+ p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);
+ p->addAttribute(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);
p->link();
p->updateUniforms();
diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h
index 09f70b987c..6ab3ed7559 100644
--- a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h
+++ b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h
@@ -15,9 +15,9 @@ public:
virtual std::string title();
virtual std::string subtitle();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
CREATE_FUNC(ShaderTestDemo);
};
diff --git a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id b/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id
index ddf3d1f722..e04e178c10 100644
--- a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id
+++ b/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id
@@ -1 +1 @@
-715f77e7fdc777c303783dad8b6ce3e1b19526d7
\ No newline at end of file
+8853550dc382b38c368250fb940660f35ee5ad4d
\ No newline at end of file
diff --git a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.h b/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.h
index ea4d175666..7cd867b38c 100644
--- a/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.h
+++ b/samples/Cpp/TestCpp/Classes/SpriteTest/SpriteTest.h
@@ -19,9 +19,9 @@ public:
virtual std::string subtitle();
virtual void onEnter();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
};
class Sprite1 : public SpriteTestDemo
diff --git a/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.cpp b/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.cpp
index cda39d5f81..55ccc82be6 100644
--- a/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.cpp
@@ -78,7 +78,7 @@ TextInputTest::TextInputTest()
}
-void TextInputTest::restartCallback(Object* pSender)
+void TextInputTest::restartCallback(Object* sender)
{
Scene* s = new TextInputTestScene();
s->addChild(restartTextInputTest());
@@ -87,7 +87,7 @@ void TextInputTest::restartCallback(Object* pSender)
s->release();
}
-void TextInputTest::nextCallback(Object* pSender)
+void TextInputTest::nextCallback(Object* sender)
{
Scene* s = new TextInputTestScene();
s->addChild( nextTextInputTest() );
@@ -95,7 +95,7 @@ void TextInputTest::nextCallback(Object* pSender)
s->release();
}
-void TextInputTest::backCallback(Object* pSender)
+void TextInputTest::backCallback(Object* sender)
{
Scene* s = new TextInputTestScene();
s->addChild( backTextInputTest() );
@@ -175,21 +175,21 @@ void KeyboardNotificationLayer::keyboardWillShow(IMEKeyboardNotificationInfo& in
// Layer function
-bool KeyboardNotificationLayer::ccTouchBegan(Touch *pTouch, Event *pEvent)
+bool KeyboardNotificationLayer::ccTouchBegan(Touch *touch, Event *event)
{
CCLOG("++++++++++++++++++++++++++++++++++++++++++++");
- _beginPos = pTouch->getLocation();
+ _beginPos = touch->getLocation();
return true;
}
-void KeyboardNotificationLayer::ccTouchEnded(Touch *pTouch, Event *pEvent)
+void KeyboardNotificationLayer::ccTouchEnded(Touch *touch, Event *event)
{
if (! _trackNode)
{
return;
}
- Point endPos = pTouch->getLocation();
+ Point endPos = touch->getLocation();
float delta = 5.0f;
if (::abs(endPos.x - _beginPos.x) > delta
@@ -202,7 +202,7 @@ void KeyboardNotificationLayer::ccTouchEnded(Touch *pTouch, Event *pEvent)
// decide the trackNode is clicked.
Rect rect;
- Point point = convertTouchToNodeSpaceAR(pTouch);
+ Point point = convertTouchToNodeSpaceAR(touch);
CCLOG("KeyboardNotificationLayer:clickedAt(%f,%f)", point.x, point.y);
rect = getRect(_trackNode);
@@ -331,7 +331,7 @@ void TextFieldTTFActionTest::onExit()
}
// TextFieldDelegate protocol
-bool TextFieldTTFActionTest::onTextFieldAttachWithIME(TextFieldTTF * pSender)
+bool TextFieldTTFActionTest::onTextFieldAttachWithIME(TextFieldTTF * sender)
{
if (! _action)
{
@@ -341,7 +341,7 @@ bool TextFieldTTFActionTest::onTextFieldAttachWithIME(TextFieldTTF * pSender)
return false;
}
-bool TextFieldTTFActionTest::onTextFieldDetachWithIME(TextFieldTTF * pSender)
+bool TextFieldTTFActionTest::onTextFieldDetachWithIME(TextFieldTTF * sender)
{
if (_action)
{
@@ -352,7 +352,7 @@ bool TextFieldTTFActionTest::onTextFieldDetachWithIME(TextFieldTTF * pSender)
return false;
}
-bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF * pSender, const char * text, int nLen)
+bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF * sender, const char * text, int nLen)
{
// if insert enter, treat as default to detach with ime
if ('\n' == *text)
@@ -361,7 +361,7 @@ bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF * pSender, const
}
// if the textfield's char count more than _charLimit, doesn't insert text anymore.
- if (pSender->getCharCount() >= _charLimit)
+ if (sender->getCharCount() >= _charLimit)
{
return true;
}
@@ -373,10 +373,10 @@ bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF * pSender, const
label->setColor(color);
// move the sprite from top to position
- Point endPos = pSender->getPosition();
- if (pSender->getCharCount())
+ Point endPos = sender->getPosition();
+ if (sender->getCharCount())
{
- endPos.x += pSender->getContentSize().width / 2;
+ endPos.x += sender->getContentSize().width / 2;
}
Size inputTextSize = label->getContentSize();
Point beginPos(endPos.x, Director::getInstance()->getWinSize().height - inputTextSize.height * 2);
@@ -397,15 +397,15 @@ bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF * pSender, const
return false;
}
-bool TextFieldTTFActionTest::onTextFieldDeleteBackward(TextFieldTTF * pSender, const char * delText, int nLen)
+bool TextFieldTTFActionTest::onTextFieldDeleteBackward(TextFieldTTF * sender, const char * delText, int nLen)
{
// create a delete text sprite and do some action
LabelTTF * label = LabelTTF::create(delText, FONT_NAME, FONT_SIZE);
this->addChild(label);
// move the sprite to fly out
- Point beginPos = pSender->getPosition();
- Size textfieldSize = pSender->getContentSize();
+ Point beginPos = sender->getPosition();
+ Size textfieldSize = sender->getContentSize();
Size labelSize = label->getContentSize();
beginPos.x += (textfieldSize.width - labelSize.width) / 2.0f;
@@ -431,7 +431,7 @@ bool TextFieldTTFActionTest::onTextFieldDeleteBackward(TextFieldTTF * pSender, c
return false;
}
-bool TextFieldTTFActionTest::onDraw(TextFieldTTF * pSender)
+bool TextFieldTTFActionTest::onDraw(TextFieldTTF * sender)
{
return false;
}
diff --git a/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.h b/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.h
index ed4ed39a35..237a62c615 100644
--- a/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.h
+++ b/samples/Cpp/TestCpp/Classes/TextInputTest/TextInputTest.h
@@ -15,9 +15,9 @@ class TextInputTest : public BaseTest
public:
TextInputTest();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
std::string title();
void addKeyboardNotificationLayer(KeyboardNotificationLayer * layer);
@@ -41,8 +41,8 @@ public:
virtual void keyboardWillShow(IMEKeyboardNotificationInfo& info);
// Layer
- virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent);
- virtual void ccTouchEnded(Touch *pTouch, Event *pEvent);
+ virtual bool ccTouchBegan(Touch *touch, Event *event);
+ virtual void ccTouchEnded(Touch *touch, Event *event);
protected:
Node * _trackNode;
@@ -87,11 +87,11 @@ public:
virtual void onExit();
// TextFieldDelegate
- virtual bool onTextFieldAttachWithIME(TextFieldTTF * pSender);
- virtual bool onTextFieldDetachWithIME(TextFieldTTF * pSender);
- virtual bool onTextFieldInsertText(TextFieldTTF * pSender, const char * text, int nLen);
- virtual bool onTextFieldDeleteBackward(TextFieldTTF * pSender, const char * delText, int nLen);
- virtual bool onDraw(TextFieldTTF * pSender);
+ virtual bool onTextFieldAttachWithIME(TextFieldTTF * sender);
+ virtual bool onTextFieldDetachWithIME(TextFieldTTF * sender);
+ virtual bool onTextFieldInsertText(TextFieldTTF * sender, const char * text, int nLen);
+ virtual bool onTextFieldDeleteBackward(TextFieldTTF * sender, const char * delText, int nLen);
+ virtual bool onDraw(TextFieldTTF * sender);
};
class TextInputTestScene : public TestScene
diff --git a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp
index 918c66eb44..f3e7aa92a2 100644
--- a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp
@@ -10,6 +10,8 @@ enum {
static std::function createFunctions[] =
{
+ CL(TexturePVRv3Premult),
+
CL(TextureMemoryAlloc),
CL(TextureAlias),
CL(TexturePVRMipMap),
@@ -128,7 +130,7 @@ TextureDemo::~TextureDemo()
TextureCache::getInstance()->dumpCachedTextureInfo();
}
-void TextureDemo::restartCallback(Object* pSender)
+void TextureDemo::restartCallback(Object* sender)
{
Scene *s = new TextureTestScene();
s->addChild(restartTextureTest());
@@ -136,7 +138,7 @@ void TextureDemo::restartCallback(Object* pSender)
s->autorelease();
}
-void TextureDemo::nextCallback(Object* pSender)
+void TextureDemo::nextCallback(Object* sender)
{
Scene *s = new TextureTestScene();
s->addChild(nextTextureTest());
@@ -144,7 +146,7 @@ void TextureDemo::nextCallback(Object* pSender)
s->autorelease();
}
-void TextureDemo::backCallback(Object* pSender)
+void TextureDemo::backCallback(Object* sender)
{
Scene *s = new TextureTestScene();
s->addChild(backTextureTest());
@@ -1313,7 +1315,7 @@ void TexturePixelFormat::onEnter()
addChild(background, -1);
// RGBA 8888 image (32-bit)
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA8888);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888);
Sprite *sprite1 = Sprite::create("Images/test-rgba1.png");
sprite1->setPosition(Point(1*s.width/7, s.height/2+32));
addChild(sprite1, 0);
@@ -1322,7 +1324,7 @@ void TexturePixelFormat::onEnter()
TextureCache::getInstance()->removeTexture(sprite1->getTexture());
// RGBA 4444 image (16-bit)
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA4444);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA4444);
Sprite *sprite2 = Sprite::create("Images/test-rgba1.png");
sprite2->setPosition(Point(2*s.width/7, s.height/2-32));
addChild(sprite2, 0);
@@ -1331,7 +1333,7 @@ void TexturePixelFormat::onEnter()
TextureCache::getInstance()->removeTexture(sprite2->getTexture());
// RGB5A1 image (16-bit)
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGB5A1);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGB5A1);
Sprite *sprite3 = Sprite::create("Images/test-rgba1.png");
sprite3->setPosition(Point(3*s.width/7, s.height/2+32));
addChild(sprite3, 0);
@@ -1340,7 +1342,7 @@ void TexturePixelFormat::onEnter()
TextureCache::getInstance()->removeTexture(sprite3->getTexture());
// RGB888 image
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGB888);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGB888);
Sprite *sprite4 = Sprite::create("Images/test-rgba1.png");
sprite4->setPosition(Point(4*s.width/7, s.height/2-32));
addChild(sprite4, 0);
@@ -1349,7 +1351,7 @@ void TexturePixelFormat::onEnter()
TextureCache::getInstance()->removeTexture(sprite4->getTexture());
// RGB565 image (16-bit)
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGB565);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGB565);
Sprite *sprite5 = Sprite::create("Images/test-rgba1.png");
sprite5->setPosition(Point(5*s.width/7, s.height/2+32));
addChild(sprite5, 0);
@@ -1358,7 +1360,7 @@ void TexturePixelFormat::onEnter()
TextureCache::getInstance()->removeTexture(sprite5->getTexture());
// A8 image (8-bit)
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_A8);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::A8);
Sprite *sprite6 = Sprite::create("Images/test-rgba1.png");
sprite6->setPosition(Point(6*s.width/7, s.height/2-32));
addChild(sprite6, 0);
@@ -1382,7 +1384,7 @@ void TexturePixelFormat::onEnter()
sprite5->runAction(seq_4ever5);
// restore default
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_Default);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::DEFAULT);
TextureCache::getInstance()->dumpCachedTextureInfo();
}
@@ -1412,8 +1414,7 @@ void TextureBlend::onEnter()
Sprite *cloud = Sprite::create("Images/test_blend.png");
addChild(cloud, i+1, 100+i);
cloud->setPosition(Point(50+25*i, 80));
- BlendFunc blendFunc1 = { GL_ONE, GL_ONE_MINUS_SRC_ALPHA };
- cloud->setBlendFunc(blendFunc1);
+ cloud->setBlendFunc( BlendFunc::ALPHA_PREMULTIPLIED );
// CENTER sprites have also alpha pre-multiplied
// they use by default GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA
@@ -1937,7 +1938,7 @@ TexturePVRv3Premult::TexturePVRv3Premult()
transformSprite(pvr2);
// PNG
- Texture2D::setDefaultAlphaPixelFormat(kTexture2DPixelFormat_RGBA8888);
+ Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888);
TextureCache::getInstance()->removeTextureForKey("Images/grossinis_sister1-testalpha.png");
Sprite *png = Sprite::create("Images/grossinis_sister1-testalpha.png");
addChild(png, 0);
diff --git a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h
index b557237c98..581c4b59bb 100644
--- a/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h
+++ b/samples/Cpp/TestCpp/Classes/Texture2dTest/Texture2dTest.h
@@ -13,9 +13,9 @@ public:
virtual std::string subtitle();
virtual void onEnter();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
};
class TextureTIFF : public TextureDemo
diff --git a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp
index 876478a58a..943f9d6485 100644
--- a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.cpp
@@ -150,12 +150,12 @@ void TMXOrthoTest::onEnter()
{
TileDemo::onEnter();
- Director::getInstance()->setProjection(kDirectorProjection3D);
+ Director::getInstance()->setProjection(Director::Projection::_3D);
}
void TMXOrthoTest::onExit()
{
- Director::getInstance()->setProjection(kDirectorProjection2D);
+ Director::getInstance()->setProjection(Director::Projection::_2D);
TileDemo::onExit();
}
@@ -659,10 +659,10 @@ void TMXOrthoObjectsTest::draw()
glLineWidth(3);
- ccDrawLine( Point((float)x, (float)y), Point((float)(x+width), (float)y) );
- ccDrawLine( Point((float)(x+width), (float)y), Point((float)(x+width), (float)(y+height)) );
- ccDrawLine( Point((float)(x+width), (float)(y+height)), Point((float)x, (float)(y+height)) );
- ccDrawLine( Point((float)x, (float)(y+height)), Point((float)x, (float)y) );
+ DrawPrimitives::drawLine( Point((float)x, (float)y), Point((float)(x+width), (float)y) );
+ DrawPrimitives::drawLine( Point((float)(x+width), (float)y), Point((float)(x+width), (float)(y+height)) );
+ DrawPrimitives::drawLine( Point((float)(x+width), (float)(y+height)), Point((float)x, (float)(y+height)) );
+ DrawPrimitives::drawLine( Point((float)x, (float)(y+height)), Point((float)x, (float)y) );
glLineWidth(1);
}
@@ -736,10 +736,10 @@ void TMXIsoObjectsTest::draw()
glLineWidth(3);
- ccDrawLine( Point(x,y), Point(x+width,y) );
- ccDrawLine( Point(x+width,y), Point(x+width,y+height) );
- ccDrawLine( Point(x+width,y+height), Point(x,y+height) );
- ccDrawLine( Point(x,y+height), Point(x,y) );
+ DrawPrimitives::drawLine( Point(x,y), Point(x+width,y) );
+ DrawPrimitives::drawLine( Point(x+width,y), Point(x+width,y+height) );
+ DrawPrimitives::drawLine( Point(x+width,y+height), Point(x,y+height) );
+ DrawPrimitives::drawLine( Point(x,y+height), Point(x,y) );
glLineWidth(1);
}
@@ -973,13 +973,13 @@ void TMXIsoVertexZ::onEnter()
TileDemo::onEnter();
// TIP: 2d projection should be used
- Director::getInstance()->setProjection(kDirectorProjection2D);
+ Director::getInstance()->setProjection(Director::Projection::_2D);
}
void TMXIsoVertexZ::onExit()
{
// At exit use any other projection.
- // Director::getInstance()->setProjection:kDirectorProjection3D);
+ // Director::getInstance()->setProjection:Director::Projection::_3D);
TileDemo::onExit();
}
@@ -1042,13 +1042,13 @@ void TMXOrthoVertexZ::onEnter()
TileDemo::onEnter();
// TIP: 2d projection should be used
- Director::getInstance()->setProjection(kDirectorProjection2D);
+ Director::getInstance()->setProjection(Director::Projection::_2D);
}
void TMXOrthoVertexZ::onExit()
{
// At exit use any other projection.
- // Director::getInstance()->setProjection:kDirectorProjection3D);
+ // Director::getInstance()->setProjection:Director::Projection::_3D);
TileDemo::onExit();
}
@@ -1452,7 +1452,7 @@ void TileDemo::onEnter()
BaseTest::onEnter();
}
-void TileDemo::restartCallback(Object* pSender)
+void TileDemo::restartCallback(Object* sender)
{
Scene* s = new TileMapTestScene();
s->addChild(restartTileMapAction());
@@ -1461,7 +1461,7 @@ void TileDemo::restartCallback(Object* pSender)
s->release();
}
-void TileDemo::nextCallback(Object* pSender)
+void TileDemo::nextCallback(Object* sender)
{
Scene* s = new TileMapTestScene();
s->addChild( nextTileMapAction() );
@@ -1469,7 +1469,7 @@ void TileDemo::nextCallback(Object* pSender)
s->release();
}
-void TileDemo::backCallback(Object* pSender)
+void TileDemo::backCallback(Object* sender)
{
Scene* s = new TileMapTestScene();
s->addChild( backTileMapAction() );
@@ -1477,9 +1477,9 @@ void TileDemo::backCallback(Object* pSender)
s->release();
}
-void TileDemo::ccTouchesMoved(Set *pTouches, Event *pEvent)
+void TileDemo::ccTouchesMoved(Set *touches, Event *event)
{
- Touch *touch = (Touch*)pTouches->anyObject();
+ Touch *touch = static_cast(touches->anyObject());
Point diff = touch->getDelta();
Node *node = getChildByTag(kTagTileMap);
@@ -1540,10 +1540,10 @@ void TMXGIDObjectsTest::draw()
glLineWidth(3);
- ccDrawLine(Point(x, y), Point(x + width, y));
- ccDrawLine(Point(x + width, y), Point(x + width, y + height));
- ccDrawLine(Point(x + width,y + height), Point(x,y + height));
- ccDrawLine(Point(x,y + height), Point(x,y));
+ DrawPrimitives::drawLine(Point(x, y), Point(x + width, y));
+ DrawPrimitives::drawLine(Point(x + width, y), Point(x + width, y + height));
+ DrawPrimitives::drawLine(Point(x + width,y + height), Point(x,y + height));
+ DrawPrimitives::drawLine(Point(x,y + height), Point(x,y));
glLineWidth(1);
}
diff --git a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h
index 0eb38c8196..a3aa9ae0e0 100644
--- a/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h
+++ b/samples/Cpp/TestCpp/Classes/TileMapTest/TileMapTest.h
@@ -14,11 +14,11 @@ public:
virtual std::string subtitle();
virtual void onEnter();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
- virtual void ccTouchesMoved(Set *pTouches, Event *pEvent);
+ virtual void ccTouchesMoved(Set *touches, Event *event);
};
class TileMapTest : public TileDemo
diff --git a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp
index 9c192f0ba8..e79f1c58a6 100644
--- a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp
@@ -18,7 +18,7 @@ class FlipXLeftOver : public TransitionFlipX
public:
static TransitionScene* create(float t, Scene* s)
{
- return TransitionFlipX::create(t, s, kTransitionOrientationLeftOver);
+ return TransitionFlipX::create(t, s, TransitionScene::Orientation::LEFT_OVER);
}
};
@@ -27,7 +27,7 @@ class FlipXRightOver : public TransitionFlipX
public:
static TransitionScene* create(float t, Scene* s)
{
- return TransitionFlipX::create(t, s, kTransitionOrientationRightOver);
+ return TransitionFlipX::create(t, s, TransitionScene::Orientation::RIGHT_OVER);
}
};
@@ -36,7 +36,7 @@ class FlipYUpOver : public TransitionFlipY
public:
static TransitionScene* create(float t, Scene* s)
{
- return TransitionFlipY::create(t, s, kTransitionOrientationUpOver);
+ return TransitionFlipY::create(t, s, TransitionScene::Orientation::UP_OVER);
}
};
@@ -45,7 +45,7 @@ class FlipYDownOver : public TransitionFlipY
public:
static TransitionScene* create(float t, Scene* s)
{
- return TransitionFlipY::create(t, s, kTransitionOrientationDownOver);
+ return TransitionFlipY::create(t, s, TransitionScene::Orientation::DOWN_OVER);
}
};
@@ -54,7 +54,7 @@ class FlipAngularLeftOver : public TransitionFlipAngular
public:
static TransitionScene* create(float t, Scene* s)
{
- return TransitionFlipAngular::create(t, s, kTransitionOrientationLeftOver);
+ return TransitionFlipAngular::create(t, s, TransitionScene::Orientation::LEFT_OVER);
}
};
@@ -63,7 +63,7 @@ class FlipAngularRightOver : public TransitionFlipAngular
public:
static TransitionScene* create(float t, Scene* s)
{
- return TransitionFlipAngular::create(t, s, kTransitionOrientationRightOver);
+ return TransitionFlipAngular::create(t, s, TransitionScene::Orientation::RIGHT_OVER);
}
};
@@ -72,7 +72,7 @@ class ZoomFlipXLeftOver : public TransitionZoomFlipX
public:
static TransitionScene* create(float t, Scene* s)
{
- return TransitionZoomFlipX::create(t, s, kTransitionOrientationLeftOver);
+ return TransitionZoomFlipX::create(t, s, TransitionScene::Orientation::LEFT_OVER);
}
};
@@ -81,7 +81,7 @@ class ZoomFlipXRightOver : public TransitionZoomFlipX
public:
static TransitionScene* create(float t, Scene* s)
{
- return TransitionZoomFlipX::create(t, s, kTransitionOrientationRightOver);
+ return TransitionZoomFlipX::create(t, s, TransitionScene::Orientation::RIGHT_OVER);
}
};
@@ -90,7 +90,7 @@ class ZoomFlipYUpOver : public TransitionZoomFlipY
public:
static TransitionScene* create(float t, Scene* s)
{
- return TransitionZoomFlipY::create(t, s, kTransitionOrientationUpOver);
+ return TransitionZoomFlipY::create(t, s, TransitionScene::Orientation::UP_OVER);
}
};
@@ -100,7 +100,7 @@ class ZoomFlipYDownOver : public TransitionZoomFlipY
public:
static TransitionScene* create(float t, Scene* s)
{
- return TransitionZoomFlipY::create(t, s, kTransitionOrientationDownOver);
+ return TransitionZoomFlipY::create(t, s, TransitionScene::Orientation::DOWN_OVER);
}
};
@@ -109,7 +109,7 @@ class ZoomFlipAngularLeftOver : public TransitionZoomFlipAngular
public:
static TransitionScene* create(float t, Scene* s)
{
- return TransitionZoomFlipAngular::create(t, s, kTransitionOrientationLeftOver);
+ return TransitionZoomFlipAngular::create(t, s, TransitionScene::Orientation::LEFT_OVER);
}
};
@@ -118,7 +118,7 @@ class ZoomFlipAngularRightOver : public TransitionZoomFlipAngular
public:
static TransitionScene* create(float t, Scene* s)
{
- return TransitionZoomFlipAngular::create(t, s, kTransitionOrientationRightOver);
+ return TransitionZoomFlipAngular::create(t, s, TransitionScene::Orientation::RIGHT_OVER);
}
};
@@ -318,7 +318,7 @@ TestLayer1::~TestLayer1(void)
}
-void TestLayer1::restartCallback(Object* pSender)
+void TestLayer1::restartCallback(Object* sender)
{
Scene* s = new TransitionsTestScene();
@@ -334,7 +334,7 @@ void TestLayer1::restartCallback(Object* pSender)
}
}
-void TestLayer1::nextCallback(Object* pSender)
+void TestLayer1::nextCallback(Object* sender)
{
s_nSceneIdx++;
s_nSceneIdx = s_nSceneIdx % MAX_LAYER;
@@ -353,7 +353,7 @@ void TestLayer1::nextCallback(Object* pSender)
}
}
-void TestLayer1::backCallback(Object* pSender)
+void TestLayer1::backCallback(Object* sender)
{
s_nSceneIdx--;
int total = MAX_LAYER;
@@ -447,7 +447,7 @@ TestLayer2::~TestLayer2()
}
-void TestLayer2::restartCallback(Object* pSender)
+void TestLayer2::restartCallback(Object* sender)
{
Scene* s = new TransitionsTestScene();
@@ -463,7 +463,7 @@ void TestLayer2::restartCallback(Object* pSender)
}
}
-void TestLayer2::nextCallback(Object* pSender)
+void TestLayer2::nextCallback(Object* sender)
{
s_nSceneIdx++;
s_nSceneIdx = s_nSceneIdx % MAX_LAYER;
@@ -482,7 +482,7 @@ void TestLayer2::nextCallback(Object* pSender)
}
}
-void TestLayer2::backCallback(Object* pSender)
+void TestLayer2::backCallback(Object* sender)
{
s_nSceneIdx--;
int total = MAX_LAYER;
diff --git a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.h b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.h
index c488a15361..ccf7ba3100 100644
--- a/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.h
+++ b/samples/Cpp/TestCpp/Classes/TransitionsTest/TransitionsTest.h
@@ -17,9 +17,9 @@ public:
TestLayer1(void);
~TestLayer1(void);
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
void step(float dt);
@@ -35,9 +35,9 @@ public:
TestLayer2(void);
~TestLayer2(void);
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
void step(float dt);
diff --git a/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp b/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp
index ef3b133d5e..afb4388c5d 100644
--- a/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp
+++ b/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp
@@ -61,21 +61,21 @@ void ZwoptexTest::onEnter()
BaseTest::onEnter();
}
-void ZwoptexTest::restartCallback(Object* pSender)
+void ZwoptexTest::restartCallback(Object* sender)
{
Scene *s = ZwoptexTestScene::create();
s->addChild(restartZwoptexTest());
Director::getInstance()->replaceScene(s);
}
-void ZwoptexTest::nextCallback(Object* pSender)
+void ZwoptexTest::nextCallback(Object* sender)
{
Scene *s = ZwoptexTestScene::create();
s->addChild(nextZwoptexTest());
Director::getInstance()->replaceScene(s);
}
-void ZwoptexTest::backCallback(Object* pSender)
+void ZwoptexTest::backCallback(Object* sender)
{
Scene *s = ZwoptexTestScene::create();
s->addChild(backZwoptexTest());
diff --git a/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.h b/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.h
index 6b3f25744b..76b8cc0ef4 100644
--- a/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.h
+++ b/samples/Cpp/TestCpp/Classes/ZwoptexTest/ZwoptexTest.h
@@ -9,9 +9,9 @@ class ZwoptexTest : public BaseTest
public:
virtual void onEnter();
- void restartCallback(Object* pSender);
- void nextCallback(Object* pSender);
- void backCallback(Object* pSender);
+ void restartCallback(Object* sender);
+ void nextCallback(Object* sender);
+ void backCallback(Object* sender);
virtual std::string title();
virtual std::string subtitle();
diff --git a/samples/Cpp/TestCpp/Classes/controller.cpp b/samples/Cpp/TestCpp/Classes/controller.cpp
index 522bb1c052..7846a7332d 100644
--- a/samples/Cpp/TestCpp/Classes/controller.cpp
+++ b/samples/Cpp/TestCpp/Classes/controller.cpp
@@ -129,13 +129,13 @@ TestController::~TestController()
{
}
-void TestController::menuCallback(Object * pSender)
+void TestController::menuCallback(Object * sender)
{
Director::getInstance()->purgeCachedData();
// get the userdata, it's the index of the menu item clicked
- MenuItem* menuItem = (MenuItem *)(pSender);
+ MenuItem* menuItem = static_cast