mirror of https://github.com/axmolengine/axmol.git
Merge pull request #14499 from xiaofeng11/v3_combine_safety
Change ASSERT to safety mode
This commit is contained in:
commit
d0ce2473a1
|
@ -1048,7 +1048,7 @@ bool Bundle3D::loadJson(const std::string& path)
|
||||||
if (_jsonReader.ParseInsitu<0>(_jsonBuffer).HasParseError())
|
if (_jsonReader.ParseInsitu<0>(_jsonBuffer).HasParseError())
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
CCASSERT(false, "Parse json failed");
|
CCLOG("Parse json failed in Bundle3D::loadJson function");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -618,44 +618,35 @@ void InnerActionFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
|
||||||
|
|
||||||
void InnerActionFrame::setStartFrameIndex(int frameIndex)
|
void InnerActionFrame::setStartFrameIndex(int frameIndex)
|
||||||
{
|
{
|
||||||
#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only
|
|
||||||
if (_enterWithName)
|
if (_enterWithName)
|
||||||
{
|
{
|
||||||
CCLOG(" cannot set start when enter frame with name. setEnterWithName false firstly!");
|
CCLOG(" cannot set start when enter frame with name. setEnterWithName false firstly!");
|
||||||
throw std::exception();
|
return;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
CCASSERT(!_enterWithName, " cannot setStartFrameIndex when enterWithName is set");
|
|
||||||
#endif
|
|
||||||
_startFrameIndex = frameIndex;
|
_startFrameIndex = frameIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InnerActionFrame::setEndFrameIndex(int frameIndex)
|
void InnerActionFrame::setEndFrameIndex(int frameIndex)
|
||||||
{
|
{
|
||||||
#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only
|
|
||||||
if (_enterWithName)
|
if (_enterWithName)
|
||||||
{
|
{
|
||||||
CCLOG(" cannot set end when enter frame with name. setEnterWithName false firstly!");
|
CCLOG(" cannot set end when enter frame with name. setEnterWithName false firstly!");
|
||||||
throw std::exception();
|
return;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
CCASSERT(!_enterWithName, " cannot setEndFrameIndex when enterWithName is set");
|
|
||||||
#endif
|
|
||||||
_endFrameIndex = frameIndex;
|
_endFrameIndex = frameIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
void InnerActionFrame::setAnimationName(const std::string& animationName)
|
void InnerActionFrame::setAnimationName(const std::string& animationName)
|
||||||
{
|
{
|
||||||
#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only
|
|
||||||
if (!_enterWithName)
|
if (!_enterWithName)
|
||||||
{
|
{
|
||||||
CCLOG(" cannot set aniamtioname when enter frame with index. setEnterWithName true firstly!");
|
CCLOG(" cannot set aniamtioname when enter frame with index. setEnterWithName true firstly!");
|
||||||
throw std::exception();
|
return;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
CCASSERT(_enterWithName, " cannot set aniamtioname when enter frame with index. setEnterWithName true firstly!");
|
|
||||||
#endif
|
|
||||||
_animationName = animationName;
|
_animationName = animationName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue