int GeoLayer::aatrigon(int16_t x1, int16_t y1, int16_t x2, int16_t y2, int16_t x3, int16_t y3, uint32_t col) { if(!surf) { error("%s can't run: layer not initialized", __PRETTY_FUNCTION__); return -1; } res = aatrigonColor(surf, x1, y1, x2, y2, x3, y3, col); if(res < 0) error("error in %s", __PRETTY_FUNCTION__); return(res); }
void foldicon(int folded, int exposure_level, int x, int top, int height, int y, SDL_Surface *surface, style *st, int highlighted) { // x is a left edge, y is a centre SDL_Surface *icon; int colour_index; if(folded) icon = st->collapsedicon; else icon = st->expandedicon; colour_index = folded ? st->foldcollapsedcolour : st->foldexpandedcolour; if(highlighted) colour_index = st->highlightcolour; if(!folded) { Uint32 pen; exposure_level++; if(exposure_level == 1) pen = colour->pens->item(st->foldexposed1colour); else if(exposure_level == 2) pen = colour->pens->item(st->foldexposed2colour); else pen = colour->pens->item(st->foldexposed3colour); /* boxColor(surface, x + 7, y, x + 13, y + (st->text_ascent - st->text_descent), pen); */ boxColor(surface, x + 7, y, x + 13, top + height - 1, pen); } if(icon == NULL) { boxColor(surface, x, y - 10, x + 20, y + 10, colour->pens->item(colour_index)); rectangleColor(surface, x, y - 10, x + 20, y + 10, colour->black_pen); filledTrigonColor(surface, x + 3, y - 6, x + 17, y - 6, x + 10, y + 6, colour->white_pen); aatrigonColor(surface, x + 3, y - 6, x + 17, y - 6, x + 10, y + 6, colour->black_pen); } else { SDL_Rect dst; dst.x = x + 10 - (icon->w / 2); dst.y = y - (icon->h / 2); SDL_BlitSurface(icon, NULL, surface, &dst); } }
static PyObject* _gfx_aatrigoncolor (PyObject *self, PyObject* args) { PyObject *surface, *color, *p1, *p2, *p3; int x1, x2, x3, _y1, y2, y3; pguint32 c; ASSERT_VIDEO_INIT (NULL); if (!PyArg_ParseTuple (args, "OOOOO:aatrigon", &surface, &p1, &p2, &p3, &color)) { PyErr_Clear (); if (!PyArg_ParseTuple (args, "OiiiiiiO:aatrigon", &surface, &x1, &_y1, &x2, &y2, &x3, &y3, &color)) return NULL; } else { if (!PointFromObj (p1, &x1, &_y1) || !PointFromObj (p2, &x2, &y2) || !PointFromObj (p3, &x3, &y3)) return NULL; } if (!PySDLSurface_Check (surface)) { PyErr_SetString (PyExc_TypeError, "surface must be a Surface"); return NULL; } if (!ColorFromObj (color, &c)) return NULL; if (aatrigonColor (((PySDLSurface*)surface)->surface, (Sint16)x1, (Sint16)_y1, (Sint16)x2, (Sint16)y2, (Sint16)x3, (Sint16)y3, (Uint32)c) == -1) { PyErr_SetString (PyExc_PyGameError, SDL_GetError ()); return NULL; } Py_RETURN_NONE; }
void Surface::trigon(Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, const SDL_Color& c) { aatrigonColor(surface, x1, y1, x2, y2, x3, y3, getRGBA(c)); }