Ejemplo n.º 1
0
	//--------------------------------------------------------------------------------------//
	// возвращает полное им¤ у типов, которые пр¤чутьс¤ за тайпдифом
	//--------------------------------------------------------------------------------------//
	std::string getTypedef(const std::string& _type, Compound* _root)
	{
		TypeInfo type(_type);

		Compound::Enumerator enumerator = _root->getEnumerator();
		while (enumerator.next())
		{
			if (enumerator->getType() != "compound" ||
				enumerator->getKind() != "namespace") continue;

			Compound::Enumerator enumerator2 = enumerator->getEnumerator();
			while (enumerator2.next())
			{
				if (enumerator2->getKind() != "typedef" ||
					enumerator2->getName() != type.getType()) continue;

				Member* member = getByRef(enumerator->getId(), enumerator2->getId());
				type.setOnlyType(correctPlatformType(enumerator->getName(), member->getType()));
				delete member;
				member = 0;

				return type.toString();
			}
		}

		return _type;
	}
Ejemplo n.º 2
0
void swcRectangle::draw()
{
    if (!visible) return;

    const uint32_t outer_border_vertices[] =
    {
        //top
        radius_top_left.x, -border_size_top,
        width - radius_top_right.x, -border_size_top,
        width - radius_top_right.x, 0,
        radius_top_left.x, 0,
        //right
        width, radius_top_right.y,
        width + border_size_right, radius_top_right.y,
        width + border_size_right, height - radius_bottom_right.y,
        width, height - radius_bottom_right.y,
        //bottom
        radius_bottom_left.x, height,
        width - radius_bottom_right.x, height,
        width - radius_bottom_right.x, height + border_size_bottom,
        radius_bottom_left.x, height + border_size_bottom,
        //left
        -border_size_left, radius_top_left.y,
        0, radius_top_left.y,
        0, height - radius_bottom_left.y,
        -border_size_left, height - radius_bottom_left.y,
    };

    const uint32_t inner_vertices[] =
    {
        radius_top_left.x, 0,
        width - radius_top_right.x, 0,
        width, radius_top_right.y,
        width, height - radius_bottom_right.y,
        width - radius_bottom_right.x, height,
        radius_bottom_left.x, height,
        0, radius_top_left.y,
        0, height - radius_bottom_left.y,
        radius_top_left.x, radius_top_left.y,
        width - radius_top_right.x, radius_top_right.y,
        width - radius_bottom_right.x, height - radius_bottom_right.y,
        radius_bottom_left.x, height - radius_bottom_left.y,
    };

    //paint behind
    impPrePaint();

    glPushMatrix();

    glTranslatef(getX(), getY(), getZ());

//    glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA);
//    glBlendFunc(GL_ONE, GL_ZERO);

    if (needReOrder())
    {

        //setup stencils
        glClearStencil(0x0);
        glClear(GL_STENCIL_BUFFER_BIT);

        glEnable(GL_STENCIL_TEST);
        glStencilFunc(GL_ALWAYS, 0x0, 0x0);

        glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);

        //draw inner curved corners
        drawInnerCornerCurves(BOOL_EN_MSAA);

        //draw inner rectangle (cover)
        drawElements(GL_QUADS, sizeof(indices) / sizeof(indices[0]), GL_INT,
                     &inner_vertices[0], &colors[0], &indices[0]);

        //draw a texturized quad
        if (hasTexture())
        {
    //        glBlendFuncSeparate(GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ZERO);
            glBlendFunc(GL_ONE, GL_ZERO);
            drawTexturedQuad(getByRef());
        }

        glStencilFunc(GL_EQUAL, 0x0, 0xff);

        //draw outer curved/solid corners
        drawOuterCornerX(BOOL_EN_MSAA);

         //draw outer side borders
         drawElements(GL_QUADS, sizeof(outer_border_indices) / sizeof(outer_border_indices[0]), GL_INT,
                      &outer_border_vertices[0], &border_colors[0], &outer_border_indices[0]);

        glDisable(GL_STENCIL_TEST);

    } else
    {

         //draw outer side borders
         drawElements(GL_QUADS, sizeof(outer_border_indices) / sizeof(outer_border_indices[0]), GL_INT,
                      &outer_border_vertices[0], &border_colors[0], &outer_border_indices[0]);

        //draw outer curved/solid corners
        drawOuterCornerX(BOOL_EN_MSAA);

        //draw inner curved corners
        drawInnerCornerCurves(BOOL_EN_MSAA);

        //draw inner rectangle (cover)
        drawElements(GL_QUADS, sizeof(indices) / sizeof(indices[0]), GL_INT,
                     &inner_vertices[0], &colors[0], &indices[0]);

        //draw a texturized quad
        if (hasTexture())
        {
            glBlendFunc(GL_ONE, GL_ZERO);
            drawTexturedQuad(getByRef());
        }
    }

    glPopMatrix();

    //paint above the rectangle
    impPostPaint();
    //paint the components
    impShowComponents();
    //paint above all the others
    impSpecialPaint();

}