当前位置: 首页>>代码示例>>C++>>正文


C++ FZ_ASSERT函数代码示例

本文整理汇总了C++中FZ_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ FZ_ASSERT函数的具体用法?C++ FZ_ASSERT怎么用?C++ FZ_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了FZ_ASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: p_targetCallback

 CallFuncN::CallFuncN(SELProtocol *t, SELECTOR_PTR s)
 : p_targetCallback(t)
 , p_selector(s)
 {
     FZ_ASSERT( p_targetCallback != NULL, "Selector must be non-NULL");
     FZ_ASSERT( p_selector != NULL, "Target must be non-NULL");
 }
开发者ID:bambamyi,项目名称:FORZE2D,代码行数:7,代码来源:FZActionInstant.cpp

示例2: FZ_ASSERT

    void AutoList::insert(fzListItem *position, fzListItem *newItem)
    {
        FZ_ASSERT(newItem != NULL, "New item cannot be NULL");

        if(position != NULL)
        {
            FZ_ASSERT(m_count > 0, "Strange bug: List is empty");
            
            // POSITION != NULL -> INSERT AT POSITION
            newItem->p_next = position;
            newItem->p_prev = position->p_prev;
            if(position->p_prev)
                position->p_prev->p_next = newItem;
            
            position->p_prev = newItem;

        }else
        {
            // POSITION == NULL -> PUSH_BACK
            if(p_back)
                p_back->p_next = newItem;
            
            newItem->p_prev = p_back;
            newItem->p_next = NULL;
            
            p_back = newItem;
        }
        if(newItem->p_prev == NULL)
            p_front = newItem;
        
        ++m_count;
    }
开发者ID:bambamyi,项目名称:FORZE2D,代码行数:32,代码来源:FZAutoList.cpp

示例3: FZ_ASSERT

    void Director::runWithScene(Scene *scene)
    {
        FZ_ASSERT( scene != NULL, "Scene must be non-NULL");
        FZ_ASSERT( p_runningScene == NULL, "You can't run an scene if another Scene is running. Use replaceScene or pushScene instead");

        pushScene(scene);
    }
开发者ID:bambamyi,项目名称:FORZE2D,代码行数:7,代码来源:FZDirector.cpp

示例4: FZ_ASSERT

fzBuffer ResourcesManager::loadResource(const char *filename, fzUInt *outFactor) const
{
    FZ_ASSERT(filename != NULL, "Filename can not be NULL.");
    FZ_ASSERT(outFactor != NULL, "outFactor can not be NULL.");

    // REMOVING FORCED FLAGS
    char *filenameCpy = fzStrcpy(filename);
    IO::removeFileSuffix(filenameCpy);

    // LOOK FOR TEXTURE
    *outFactor = 0;
    char absolutePath[STRING_MAX_SIZE];
    fzUInt factor, priority = 0;

    while (getPath(filenameCpy, priority, absolutePath, &factor))
    {
        fzBuffer buffer = IO::loadFile(absolutePath);
        if(!buffer.isEmpty()) {
            *outFactor = factor;
            delete filenameCpy;
            return buffer;
        }
        ++priority;
    }

    FZLOGERROR("IO: \"%s\" not found.", filename);
    delete filenameCpy;
    return fzBuffer::empty();
}
开发者ID:manucorporat,项目名称:FORZE2D,代码行数:29,代码来源:FZResourcesManager.cpp

示例5: FZ_ASSERT

 void MS::pop()
 {
     FZ_ASSERT(_initialized, "The matrix stack is not initialized.");
     FZ_ASSERT(_modelview_stack.num > 1, "Cannot pop an empty stack");
     
     --_modelview_stack.num;
 }
开发者ID:bambamyi,项目名称:FORZE2D,代码行数:7,代码来源:FZMS.cpp

示例6: fzMath_mat4Vec4

    void fzMath_mat4Vec4(const float* m1, const float* m2, float* mat)
    {
        FZ_ASSERT(m1 != NULL, "Input matrix 1 cannot be NULL.");
        FZ_ASSERT(m2 != NULL, "Input matrix 2 cannot be NULL.");
        FZ_ASSERT(mat != NULL, "Output pointer cannot be NULL.");
        
#if defined(__ARM_NEON__)
        
        _NEON_mat4Vec4(m1, m2, mat);
        
#else
        
        mat[0] = m1[0] * m2[0] + m1[4] * m2[1] + m1[12];
        mat[1] = m1[1] * m2[0] + m1[5] * m2[1] + m1[13];
        mat[2] = m1[2] * m2[0] + m1[6] * m2[1] + m1[14];
        
        mat[4] = m1[0] * m2[2] + m1[4] * m2[3] + m1[12];
        mat[5] = m1[1] * m2[2] + m1[5] * m2[3] + m1[13];
        mat[6] = m1[2] * m2[2] + m1[6] * m2[3] + m1[14];
        
        mat[8] = m1[0] * m2[4] + m1[4] * m2[5] + m1[12];
        mat[9] = m1[1] * m2[4] + m1[5] * m2[5] + m1[13];
        mat[10] = m1[2] * m2[4] + m1[6] * m2[5] + m1[14];
        
        mat[12] = m1[0] * m2[6] + m1[4] * m2[7] + m1[12];
        mat[13] = m1[1] * m2[6] + m1[5] * m2[7] + m1[13];
        mat[14] = m1[2] * m2[6] + m1[6] * m2[7] + m1[14];
        
#endif
    }
开发者ID:javierprovecho,项目名称:FORZE2D,代码行数:30,代码来源:FZMath.cpp

示例7: fzMath_mat4Multiply

    void fzMath_mat4Multiply(const float* m1, const float* m2, float* mat)
    {
        FZ_ASSERT(m1 != NULL, "Input matrix 1 cannot be NULL.");
        FZ_ASSERT(m2 != NULL, "Input matrix 2 cannot be NULL.");
        FZ_ASSERT(m1 != mat, "Input matrix and output matrix cannot be the same one.");

        
        mat[0] = m1[0] * m2[0] + m1[4] * m2[1] + m1[8] * m2[2] + m1[12] * m2[3];
        mat[1] = m1[1] * m2[0] + m1[5] * m2[1] + m1[9] * m2[2] + m1[13] * m2[3];
        mat[2] = m1[2] * m2[0] + m1[6] * m2[1] + m1[10] * m2[2] + m1[14] * m2[3];
        mat[3] = m1[3] * m2[0] + m1[7] * m2[1] + m1[11] * m2[2] + m1[15] * m2[3];
        
        mat[4] = m1[0] * m2[4] + m1[4] * m2[5] + m1[8] * m2[6] + m1[12] * m2[7];
        mat[5] = m1[1] * m2[4] + m1[5] * m2[5] + m1[9] * m2[6] + m1[13] * m2[7];
        mat[6] = m1[2] * m2[4] + m1[6] * m2[5] + m1[10] * m2[6] + m1[14] * m2[7];
        mat[7] = m1[3] * m2[4] + m1[7] * m2[5] + m1[11] * m2[6] + m1[15] * m2[7];
        
        mat[8] = m1[0] * m2[8] + m1[4] * m2[9] + m1[8] * m2[10] + m1[12] * m2[11];
        mat[9] = m1[1] * m2[8] + m1[5] * m2[9] + m1[9] * m2[10] + m1[13] * m2[11];
        mat[10] = m1[2] * m2[8] + m1[6] * m2[9] + m1[10] * m2[10] + m1[14] * m2[11];
        mat[11] = m1[3] * m2[8] + m1[7] * m2[9] + m1[11] * m2[10] + m1[15] * m2[11];
        
        mat[12] = m1[0] * m2[12] + m1[4] * m2[13] + m1[8] * m2[14] + m1[12] * m2[15];
        mat[13] = m1[1] * m2[12] + m1[5] * m2[13] + m1[9] * m2[14] + m1[13] * m2[15];
        mat[14] = m1[2] * m2[12] + m1[6] * m2[13] + m1[10] * m2[14] + m1[14] * m2[15];
        mat[15] = m1[3] * m2[12] + m1[7] * m2[13] + m1[11] * m2[14] + m1[15] * m2[15];
    }
开发者ID:javierprovecho,项目名称:FORZE2D,代码行数:27,代码来源:FZMath.cpp

示例8: fzMath_mat4Copy

    void fzMath_mat4Copy(const float* src, float* dst)
    {
        FZ_ASSERT(src != NULL, "Source matrix cannot be NULL.");
        FZ_ASSERT(dst != NULL, "Destination matrix cannot be NULL.");

        _inline_mat4Copy(src, dst);
    }
开发者ID:manucorporat,项目名称:FORZE2D,代码行数:7,代码来源:FZMath.cpp

示例9: fzMath_mat4Vec4

 void fzMath_mat4Vec4(const float* m1, const float* v1, float* vOut)
 {
     FZ_ASSERT(m1 != NULL, "Input matrix 1 cannot be NULL.");
     FZ_ASSERT(v1 != NULL, "Input matrix 2 cannot be NULL.");
     FZ_ASSERT(vOut != NULL, "Output vertices cannot be NULL.");
     
     _inline_mat4Vec4(m1, v1, vOut);
 }
开发者ID:manucorporat,项目名称:FORZE2D,代码行数:8,代码来源:FZMath.cpp

示例10: m_shaderType

 GLShader::GLShader(const char *source, GLenum type)
 : m_shaderType(type), m_shader(0)
 {
     FZ_ASSERT(m_shaderType == GL_VERTEX_SHADER || m_shaderType == GL_FRAGMENT_SHADER, "Invalid shader type");
     FZ_ASSERT(source != NULL, "Argumment must be non-NULL");
     
     if(!compileShader(source))
         FZ_RAISE("GLProgram: Error compiling shader.");
 }
开发者ID:bambamyi,项目名称:FORZE2D,代码行数:9,代码来源:FZGLProgram.cpp

示例11: fzMath_mat4MultiplySafe

    void fzMath_mat4MultiplySafe(const float* m1, const float* m2, float* mOut)
    {
        FZ_ASSERT(m1 != NULL, "Input matrix 1 cannot be NULL.");
        FZ_ASSERT(m2 != NULL, "Input matrix 2 cannot be NULL.");
        FZ_ASSERT(mOut != NULL, "Output matrix cannot be NULL.");
        FZ_ASSERT(m1 != mOut, "Input and output can not have the same pointer.");

        _inline_mat4MultiplySafe(m1, m2, mOut);
    }
开发者ID:manucorporat,项目名称:FORZE2D,代码行数:9,代码来源:FZMath.cpp

示例12: FZ_ASSERT

    Event* EventManager::addEvent(const Event& newEvent)
    {
        FZ_ASSERT(newEvent.getOwner(), "Event owner can not be NULL.");

        if(!(newEvent.getType() & m_flags))
            return NULL;
            
        switch (newEvent.getState())
        {
            case kFZEventState_Began:
#if FORZE_DEBUG > 0
            {
                eventList::const_iterator it(m_events.begin());
                for(; it != m_events.end(); ++it) {
                    if(newEvent.getIdentifier() == it->getIdentifier() &&
                       newEvent.getOwner() == it->getOwner())
                    {
                        FZLOGERROR("EventManager: Event duplicated:");
                        it->log();
                    }
                }
            }
#endif
            case kFZEventState_Indifferent:
            {
                FZ_ASSERT(newEvent.getDelegate() == NULL, "Event delegate should be NULL.");
                m_events.push_back(newEvent);
                return &(m_events.back());
            }
            case kFZEventState_Updated:
            case kFZEventState_Ended:
            case kFZEventState_Cancelled:
            {
                eventList::iterator it(m_events.begin());
                for(; it != m_events.end(); ++it) {
                    Event *e = &(*it);
                    if(newEvent.getIdentifier() == e->getIdentifier() &&
                       newEvent.getOwner() == e->getOwner() &&
                       newEvent.getType() == e->getType())
                    {
                        e->update(newEvent);
                        return e;
                    }
                }
                return NULL;
            }
            default:
            {
                FZ_ASSERT(false, "Invalid event state.");
                return NULL;
            }
        }
    }
开发者ID:manucorporat,项目名称:FORZE2D,代码行数:53,代码来源:FZEventManager.cpp

示例13: FZ_ASSERT

void Grabber::begin()
{
    FZ_ASSERT(m_fbo != 0, "FBO is uninitilialez, you must grab a texture first.");
    FZ_ASSERT(m_oldFBO == -1, "This FBO is already opened");

    // cache current framebuffer
    m_oldFBO = fzGLGetFramebuffer();

    // bind FBO
    fzGLBindFramebuffer(m_fbo);

    CHECK_GL_ERROR_DEBUG();
}
开发者ID:ricardoquesada,项目名称:FORZE2D,代码行数:13,代码来源:FZGrabber.cpp

示例14: FZ_ASSERT

 bool MenuItem::event(Event& event)
 {
     FZ_ASSERT(event.isType(kFZEventType_Tap), "Event is a touch event");
     
     if(!isVisible())
         return false;
     
     switch (event.getState())
     {
         case kFZEventState_Began:
         {
             if( !m_isWaiting || !isVisible() )
                 return false;
             
             if(getBoundingBox().contains(event.getPoint())) {
                 selected();
                 m_isWaiting = false;
                 return true;
             }
             break;
         }
         case kFZEventState_Updated:
         {
             FZ_ASSERT(!m_isWaiting, "[Event updated] -- invalid state");
             
             bool isSelected = getBoundingBox().contains(event.getPoint());
             if (isSelected != m_isSelected) {
                 if(isSelected)
                     selected();
                 else
                     unselected();
             }
             
             break;
         }
         case kFZEventState_Ended:
             if(m_isSelected)
                 activate();
             
         case kFZEventState_Cancelled:
             if(m_isSelected)
                 unselected();
             
             m_isWaiting = true;
             
             break;
         default: break;
     }
     
     return false;
 }
开发者ID:bambamyi,项目名称:FORZE2D,代码行数:51,代码来源:FZMenuItem.cpp

示例15: p_innerAction

 Speed::Speed(Action *a, fzFloat s)
 : p_innerAction(a)
 , m_speed(s)
 {
     FZ_ASSERT(p_innerAction != NULL, "ActionInterval cannot be NULL.");
     p_innerAction->retain();
 }
开发者ID:manucorporat,项目名称:FORZE2D,代码行数:7,代码来源:FZAction.cpp


注:本文中的FZ_ASSERT函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。