Exemple #1
0
// Combined Lua / C++ constructor)
NexusZone::NexusZone(lua_State *L)
{
    mObjectTypeNumber = NexusTypeNumber;
    mNetFlags.set(Ghostable);

    if(L)
    {
        static LuaFunctionArgList constructorArgList = { {{ END }, { POLY, END }}, 2 };
        S32 profile = checkArgList(L, constructorArgList, "NexusZone", "constructor");

        if(profile == 1)
            setGeom(L, 1);

        LUA_REGISTER_WITH_TRACKER;
    }

    LUAW_CONSTRUCTOR_INITIALIZATIONS;
}
Exemple #2
0
void VideoNode::updateGeometry(const PaintAreas & areas)
{
    QSGGeometry *g = geometry();

    if (m_materialType == MaterialTypeVideo) {
        if (!m_validGeometry)
            g = new QSGGeometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4);

        QSGGeometry::TexturedPoint2D *v = g->vertexDataAsTexturedPoint2D();

        // Set geometry first
        setGeom(v + 0, areas.videoArea.topLeft());
        setGeom(v + 1, areas.videoArea.bottomLeft());
        setGeom(v + 2, areas.videoArea.topRight());
        setGeom(v + 3, areas.videoArea.bottomRight());

        // and then texture coordinates
        setTex(v + 0, areas.sourceRect.topLeft());
        setTex(v + 1, areas.sourceRect.bottomLeft());
        setTex(v + 2, areas.sourceRect.topRight());
        setTex(v + 3, areas.sourceRect.bottomRight());
    } else {
        if (!m_validGeometry)
            g = new QSGGeometry(QSGGeometry::defaultAttributes_Point2D(), 4);

        QSGGeometry::Point2D *v = g->vertexDataAsPoint2D();

        setGeom(v + 0, areas.videoArea.topLeft());
        setGeom(v + 1, areas.videoArea.bottomLeft());
        setGeom(v + 2, areas.videoArea.topRight());
        setGeom(v + 3, areas.videoArea.bottomRight());
    }

    if (!m_validGeometry) {
        setGeometry(g);
        m_validGeometry = true;
    }

    markDirty(DirtyGeometry);
}