Remove condition MACRO and remove ASSERT in Sprite::initWithFile function

Remove CameraFlag define for Cocos Studio only
This commit is contained in:
XiaoFeng 2015-11-26 14:47:37 +08:00
parent 397fa809da
commit 52f696945d
2 changed files with 0 additions and 14 deletions

View File

@ -58,12 +58,6 @@ enum class CameraFlag
USER6 = 1 << 6,
USER7 = 1 << 7,
USER8 = 1 << 8,
// Use in cocos studio for edit 3d relate component
SkyBox = 1 << 10,
DEFAULTCAMERA = DEFAULT | SkyBox,
PIXEL = 1 << 13,
FRONT = 1 << 14,
};
/**
* Defines a camera .

View File

@ -165,7 +165,6 @@ bool Sprite::initWithTexture(Texture2D *texture, const Rect& rect)
bool Sprite::initWithFile(const std::string& filename)
{
#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only
if (filename.empty())
{
CCLOG("Call Sprite::initWithFile with blank resource filename.");
@ -174,9 +173,6 @@ bool Sprite::initWithFile(const std::string& filename)
_fileName = filename;
_fileType = 0;
#else
CCASSERT(filename.size()>0, "Invalid filename for sprite");
#endif
Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(filename);
if (texture)
@ -196,10 +192,8 @@ bool Sprite::initWithFile(const std::string &filename, const Rect& rect)
{
CCASSERT(filename.size()>0, "Invalid filename");
#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only
_fileName = filename;
_fileType = 0;
#endif
Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(filename);
if (texture)
@ -217,10 +211,8 @@ bool Sprite::initWithSpriteFrameName(const std::string& spriteFrameName)
{
CCASSERT(spriteFrameName.size() > 0, "Invalid spriteFrameName");
#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only
_fileName = spriteFrameName;
_fileType = 1;
#endif
SpriteFrame *frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName);
return initWithSpriteFrame(frame);