コード例 #1
0
ファイル: Widget.cpp プロジェクト: RedMser/NecroEdit
std::shared_ptr<const BitmapFont> Widget::getDefaultFont(int index) const
{
	//return onGetFont(index);
	return getParentInterface() ?
		   getParentInterface()->getParentApplication().getFont(index) :
		   nullptr;
}
コード例 #2
0
static void emitParentClassMethods(PPARSEINFO pLocalPI, PINTERFACE pif)
{
  FILE* fh=pLocalPI->outFile;
  PINTERFACE pifParent=pif;

  while((pifParent=getParentInterface(pifParent))!=NULL)
    {
      GPtrArray *pArray; 
      int a;
      /* Do this parents methods */
      pArray=pifParent->pMethodArray;
      for(a=0;a<pArray->len;a++)
        {
          PMETHOD pm=(PMETHOD)g_ptr_array_index(pArray, a);

          fprintf(fh, "#define %s_%s(nomSelf, ", pif->chrName, pm->chrName);
          /* Do parameters */
          emitMethodParamsNoTypes(pLocalPI, pif, pm->pParamArray);
          fprintf(fh, " ev) \\\n");
          fprintf(fh, "        %s_%s((%s*) nomSelf, ", pifParent->chrName, pm->chrName, pifParent->chrName);
          /* Do parameters */
          emitMethodParamsNoTypes(pLocalPI, pif, pm->pParamArray);
          fprintf(fh, " ev)\n");
        }
    }
  fprintf(fh, "\n");
}
コード例 #3
0
ファイル: Widget.cpp プロジェクト: RedMser/NecroEdit
void Widget::vertexAddRect(sf::FloatRect rect, sf::Color colorTL, sf::Color colorTR, sf::Color colorBR, sf::Color colorBL)
{
	sf::Vector2f whitePos = getParentInterface() ?
							getParentInterface()->getParentApplication().getWhitePixel() :
							sf::Vector2f(0, 0);

	std::vector<sf::Vertex> vertices
	{
		sf::Vertex(sf::Vector2f(rect.left, rect.top), colorTL, whitePos),
		sf::Vertex(sf::Vector2f(rect.left+rect.width, rect.top), colorTR, whitePos),
		sf::Vertex(sf::Vector2f(rect.left, rect.top+rect.height), colorBL, whitePos),

		sf::Vertex(sf::Vector2f(rect.left+rect.width, rect.top), colorTR, whitePos),
		sf::Vertex(sf::Vector2f(rect.left+rect.width, rect.top+rect.height), colorBR, whitePos),
		sf::Vertex(sf::Vector2f(rect.left, rect.top+rect.height), colorBL, whitePos)
	};

	vertexAddTextured(vertices);
}
コード例 #4
0
ファイル: Widget.cpp プロジェクト: RedMser/NecroEdit
void Widget::vertexAdd(const std::vector<sf::Vertex> & vertices)
{
	myVertexCache.insert(myVertexCache.end(), vertices.begin(), vertices.end());

	sf::Vector2f whitePos = getParentInterface()->getParentApplication().getWhitePixel();

	// untexturize vertices.
	for (auto it = myVertexCache.end() - vertices.size(); it != myVertexCache.end(); ++it)
	{
		it->texCoords = whitePos;
	}
}