19#include <QImageReader>
38 QList<QByteArray>::iterator
iter;
45 gfx_ext = QImageReader::supportedImageFormats();
72 if (QPixmapCache::find(
QString(filename),
pm)) {
78 QPixmapCache::insert(
QString(filename), *
pm);
131 cropped->pm->fill(Qt::transparent);
137 p.setRenderHint(QPainter::SmoothPixmapTransform);
139 p.setRenderHint(QPainter::Antialiasing);
144 int mw =
mask->
pm->width();
150 p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
151 p.setRenderHint(QPainter::Antialiasing);
152 p.setRenderHint(QPainter::SmoothPixmapTransform);
204 if (
gui()->map_scale != 1.0f &&
gui()->map_font_scale) {
207 if (
qf->pointSize() !=
ssize) {
215 ns = QString::number(num);
223 u8"\0xF0\0x9F\0x84\0x8C",
249 w =
fm.horizontalAdvance(
ns);
252 pm->fill(Qt::transparent);
256 paint.setBrush(Qt::transparent);
257 paint.setPen(
QColor(Qt::black));
258 paint.drawText(
QRect(0, 0, w, h), Qt::AlignLeft | Qt::AlignVCenter,
262 paint.setPen(
QColor(Qt::yellow));
263 paint.drawText(
QRect(-2, 0, w, h), Qt::AlignLeft | Qt::AlignVCenter,
265 paint.drawText(
QRect(4, -2, w, h), Qt::AlignLeft | Qt::AlignVCenter,
267 paint.drawText(
QRect(4, 2, w, h), Qt::AlignLeft | Qt::AlignVCenter,
269 paint.drawText(
QRect(8, 0, w, h), Qt::AlignLeft | Qt::AlignVCenter,
272 paint.setPen(
QColor((num > 20) ? Qt::black : Qt::yellow));
273 paint.drawText(
QRect(0, 0, w, h), Qt::AlignLeft | Qt::AlignVCenter,
ns);
struct canvas int int struct sprite int int int int height
struct canvas int int int int struct sprite *sprite struct canvas struct color * pcolor
struct canvas int int struct sprite int int int width
static fc_font * instance()
QFont * get_font(QString name)
static GtkWidget * source
#define fc_assert_ret_val(condition, val)
const char *const city_productions
struct sprite * qtg_crop_sprite(struct sprite *source, int x, int y, int width, int height, struct sprite *mask, int mask_offset_x, int mask_offset_y, float scale, bool smooth)
static const char ** gfx_array_extensions
void qtg_get_sprite_dimensions(struct sprite *sprite, int *width, int *height)
struct sprite * qtg_load_gfxfile(const char *filename, bool svgflag)
void qtg_free_sprite(struct sprite *s)
struct sprite * qtg_load_gfxnumber(int num)
struct sprite * qtg_create_sprite(int width, int height, struct color *pcolor)
const char ** gfx_fileextensions(void)
struct sprite int int int int struct sprite * mask
struct sprite int int int int struct sprite int int float scale
struct sprite int int int int struct sprite int mask_offset_x
struct sprite int int int int struct sprite int int mask_offset_y
int tileset_hex_width(const struct tileset *t)
int tileset_hex_height(const struct tileset *t)