MCPcopy Create free account
hub / github.com/NetHack/NetHack / reversed_pixmap

Method reversed_pixmap

win/Qt/qt_glyph.cpp:222–242  ·  view source on GitHub ↗

transpose a glyph's tile horizontally, scaled for use in paper doll

Source from the content-addressed store, hash-verified

220
221// transpose a glyph's tile horizontally, scaled for use in paper doll
222QPixmap
223NetHackQtGlyphs::reversed_pixmap(
224 int glyphindx, int tileidx)
225{
226 QPixmap pxmp = glyph(glyphindx, tileidx);
227#ifdef ENHANCED_PAPERDOLL
228 qreal wid = (qreal) pxmp.width(),
229 //hgt = (qreal) pxmp.height(),
230 xscale = (qreal) qt_settings->dollWidth / (qreal) tilefile_tile_W,
231 yscale = (qreal) qt_settings->dollHeight / (qreal) tilefile_tile_H;
232 QTransform *mirrormatrix = new QTransform(
233 // negate x coordinates to flip the image across the y-axis
234 -1.0 * xscale, 0.0, 0.0, yscale,
235 // slide flipped image to the right to make things positive again
236 wid * xscale, 0.0
237 );
238 return pxmp.transformed(*mirrormatrix);
239#else
240 return pxmp;
241#endif
242}
243
244void NetHackQtGlyphs::setSize(int w, int h)
245{

Callers

nothing calls this directly

Calls 1

widthMethod · 0.45

Tested by

no test coverage detected