fixed warn.

This commit is contained in:
Dhilan007 2014-03-31 17:31:04 +08:00
parent 72811d8869
commit 51f3833a7e
2 changed files with 20 additions and 9 deletions

View File

@ -1253,13 +1253,13 @@ void BitmapFontMultiLineAlignment::stringChanged(cocos2d::Ref *sender)
switch(item->getTag())
{
case LongSentences:
static_cast<LabelBMFont*>(_labelShouldRetain)->setString(LongSentencesExample);
_labelShouldRetain->setString(LongSentencesExample);
break;
case LineBreaks:
static_cast<LabelBMFont*>(_labelShouldRetain)->setString(LineBreaksExample);
_labelShouldRetain->setString(LineBreaksExample);
break;
case Mixed:
static_cast<LabelBMFont*>(_labelShouldRetain)->setString(MixedExample);
_labelShouldRetain->setString(MixedExample);
break;
default:
@ -1279,13 +1279,13 @@ void BitmapFontMultiLineAlignment::alignmentChanged(cocos2d::Ref *sender)
switch(item->getTag())
{
case LeftAlign:
static_cast<LabelBMFont*>(_labelShouldRetain)->setAlignment(TextHAlignment::LEFT);
_labelShouldRetain->setAlignment(TextHAlignment::LEFT);
break;
case CenterAlign:
static_cast<LabelBMFont*>(_labelShouldRetain)->setAlignment(TextHAlignment::CENTER);
_labelShouldRetain->setAlignment(TextHAlignment::CENTER);
break;
case RightAlign:
static_cast<LabelBMFont*>(_labelShouldRetain)->setAlignment(TextHAlignment::RIGHT);
_labelShouldRetain->setAlignment(TextHAlignment::RIGHT);
break;
default:

View File

@ -4,6 +4,12 @@
#include "../testBasic.h"
#include "../BaseTest.h"
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif _MSC_VER >= 1400 //vs 2005 or higher
#pragma warning (push)
#pragma warning (disable: 4996)
#endif
class AtlasDemo : public BaseTest
{
@ -236,7 +242,7 @@ private:
const char* getCurrentAlignment();
private:
TextHAlignment _horizAlign;
Node* _label;
LabelTTF* _label;
TextVAlignment _vertAlign;
};
@ -285,7 +291,7 @@ public:
void onTouchesMoved(const std::vector<Touch*>& touches, Event *event);
public:
Node *_labelShouldRetain;
LabelBMFont *_labelShouldRetain;
Sprite *_arrowsBarShouldRetain;
Sprite *_arrowsShouldRetain;
MenuItemFont *_lastSentenceItem, *_lastAlignmentItem;
@ -383,7 +389,7 @@ public:
protected:
void onDraw(const kmMat4 &transform, bool transformUpdated);
private:
Node *label1;
LabelBMFont *label1;
CustomCommand _customCommand;
};
@ -445,6 +451,11 @@ public:
virtual std::string subtitle() const override;
};
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#pragma GCC diagnostic warning "-Wdeprecated-declarations"
#elif _MSC_VER >= 1400 //vs 2005 or higher
#pragma warning (pop)
#endif
// we don't support linebreak mode