transpose a glyph's tile horizontally, scaled for use in paper doll
| 220 | |
| 221 | // transpose a glyph's tile horizontally, scaled for use in paper doll |
| 222 | QPixmap |
| 223 | NetHackQtGlyphs::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 | |
| 244 | void NetHackQtGlyphs::setSize(int w, int h) |
| 245 | { |