When wielding a two-handed weapon, Qt's paper doll shows uwep in the shield slot as well as in the weapon slot to reflect that it's occupying both hands. Make the shield slot's copy be a mirror image of the weapon's tile so that it looks less like wielding two weapons.
46 lines
1.1 KiB
C++
46 lines
1.1 KiB
C++
// Copyright (c) Warwick Allison, 1999.
|
|
// Qt4 conversion copyright (c) Ray Chason, 2012-2014.
|
|
// NetHack may be freely redistributed. See license for details.
|
|
|
|
// qt_glyph.h -- class to manage the glyphs in a tile set
|
|
|
|
#ifndef QT4GLYPH_H
|
|
#define QT4GLYPH_H
|
|
|
|
namespace nethack_qt_ {
|
|
|
|
enum border_code {
|
|
NO_BORDER, BORDER_DEFAULT,
|
|
BORDER_CURSED, BORDER_UNCURSED, BORDER_BLESSED
|
|
};
|
|
|
|
class NetHackQtGlyphs {
|
|
public:
|
|
NetHackQtGlyphs();
|
|
|
|
int width() const { return size.width(); }
|
|
int height() const { return size.height(); }
|
|
void toggleSize();
|
|
void setSize(int w, int h);
|
|
|
|
void drawGlyph(QPainter &, int glyph, int pixelx, int pixely,
|
|
bool reversed = false);
|
|
void drawCell(QPainter &, int glyph, int cellx, int celly);
|
|
void drawBorderedCell(QPainter &, int glyph,
|
|
int cellx, int celly, int bordercode,
|
|
bool reversed);
|
|
QPixmap glyph(int glyphindx);
|
|
QPixmap reversed_pixmap(int glyphindx);
|
|
|
|
private:
|
|
QImage img;
|
|
QPixmap pm,pm1, pm2;
|
|
QSize size;
|
|
int tiles_per_row;
|
|
//QTransform *mirrormatrix;
|
|
};
|
|
|
|
} // namespace nethack_qt_
|
|
|
|
#endif
|