Exemplo n.º 1
0
Frame* ColorFrame::clone()
{
    ColorFrame* frame = ColorFrame::create();
    frame->setColor(_color);

    frame->cloneProperty(this);

    return frame;
}
Exemplo n.º 2
0
// ColorFrame
ColorFrame* ColorFrame::create()
{
    ColorFrame* frame = new (std::nothrow) ColorFrame();
    if (frame)
    {
        frame->autorelease();
        return frame;
    }
    CC_SAFE_DELETE(frame);
    return nullptr;
}
Frame* ActionTimelineCache::loadColorFrame(const rapidjson::Value& json)
{
    ColorFrame* frame = ColorFrame::create();

    GLubyte red   = (GLubyte)DICTOOL->getIntValue_json(json, RED);
    GLubyte green = (GLubyte)DICTOOL->getIntValue_json(json, GREEN);
    GLubyte blue  = (GLubyte)DICTOOL->getIntValue_json(json, BLUE);

    frame->setColor(Color3B(red, green, blue));

    return frame;
}
Frame* ActionTimelineCache::loadColorFrameWithFlatBuffers(const flatbuffers::ColorFrame *flatbuffers)
{
    ColorFrame* frame = ColorFrame::create();
    
    auto f_color = flatbuffers->color();
    Color3B color(f_color->r(), f_color->g(), f_color->b());
    frame->setColor(color);        
    
    int frameIndex = flatbuffers->frameIndex();
    frame->setFrameIndex(frameIndex);
    
    bool tween = flatbuffers->tween() != 0;
    frame->setTween(tween);
    
    return frame;
}