setSize(tilefile_tile_W, tilefile_tile_H);
}
-void NetHackQtGlyphs::drawGlyph(QPainter& painter, int glyph, int tileidx,
- int x, int y, bool fem, bool reversed)
+// display a map tile somewhere other than the map;
+// used for paper doll and also role/race selection
+void
+NetHackQtGlyphs::drawGlyph(
+ QPainter& painter,
+ int glyph, int tileidx,
+ int x, int y,
+ bool reversed)
{
if (!reversed) {
#if 0
int tile = glyph2tile[glyph];
- /* this is not required with the new glyph representation */
- if (fem)
- ++tile;
#else
int tile = tileidx;
#endif
painter.drawPixmap(x, y, pm, px, py, width(), height());
} else {
// for paper doll; mirrored image for left side of two-handed weapon
- painter.drawPixmap(x, y, reversed_pixmap(glyph, tileidx, fem),
+ painter.drawPixmap(x, y, reversed_pixmap(glyph, tileidx),
0, 0, width(), height());
}
}
-void NetHackQtGlyphs::drawCell(QPainter& painter, int glyph, int tileidx,
- int cellx, int celly, bool fem)
+// draw a tile into the paper doll
+void
+NetHackQtGlyphs::drawCell(
+ QPainter& painter,
+ int glyph, int tileidx,
+ int cellx, int celly)
{
drawGlyph(painter, glyph, tileidx, cellx * width(), celly * height(),
- fem, false);
+ false);
}
-void NetHackQtGlyphs::drawBorderedCell(QPainter& painter, int glyph,
- int tileidx, int cellx, int celly,
- int border, bool reversed, bool fem)
+// draw a tile into the paper doll and then draw a BUC border around it
+void
+NetHackQtGlyphs::drawBorderedCell(
+ QPainter& painter,
+ int glyph, int tileidx,
+ int cellx, int celly,
+ int border, bool reversed)
{
int wd = width(),
ht = height(),
lox = cellx * (wd + 2),
loy = celly * (ht + 2) + yoffset;
- drawGlyph(painter, glyph, tileidx, lox + 1, loy + 1, fem, reversed);
+ drawGlyph(painter, glyph, tileidx, lox + 1, loy + 1, reversed);
#ifdef TEXTCOLOR
if (border != NO_BORDER) {
}
// mis-named routine to get the pixmap for a particular glyph
-QPixmap NetHackQtGlyphs::glyph(int glyphindx UNUSED, int tileidx, bool fem UNUSED)
+QPixmap
+NetHackQtGlyphs::glyph(
+ int glyphindx UNUSED,
+ int tileidx)
{
#if 0
int tile = glyph2tile[glyphindx];
- if (fem)
- ++tile;
#else
int tile = tileidx;
#endif
}
// transpose a glyph's tile horizontally, scaled for use in paper doll
-QPixmap NetHackQtGlyphs::reversed_pixmap(int glyphindx, int tileidx, bool fem)
+QPixmap
+NetHackQtGlyphs::reversed_pixmap(
+ int glyphindx, int tileidx)
{
- QPixmap pxmp = glyph(glyphindx, tileidx, fem);
+ QPixmap pxmp = glyph(glyphindx, tileidx);
#ifdef ENHANCED_PAPERDOLL
qreal wid = (qreal) pxmp.width(),
//hgt = (qreal) pxmp.height(),
void drawGlyph(QPainter &, int glyph, int tileidx,
int pixelx, int pixely,
- bool fem, bool reversed = false);
+ bool reversed = false);
void drawCell(QPainter &, int glyph, int tileidx,
- int cellx, int celly, bool fem);
+ int cellx, int celly);
void drawBorderedCell(QPainter &, int glyph, int tileidx,
int cellx, int celly, int bordercode,
- bool reversed, bool fem = false);
- QPixmap glyph(int glyphindx, int tileidx, bool fem = false);
- QPixmap reversed_pixmap(int glyphindx, int tileidx, bool fem = false);
+ bool reversed);
+ QPixmap glyph(int glyphindx, int tileidx);
+ QPixmap reversed_pixmap(int glyphindx, int tileidx);
private:
QImage img;
unsigned short g = Glyph(i,j);
unsigned special = Glyphflags(i, j);
unsigned tileidx = Glyphtileidx(i, j);
- bool femflag = (special & MG_FEMALE) ? true : false;
- glyphs.drawCell(painter, g, tileidx, i, j, femflag);
+
+ glyphs.drawCell(painter, g, tileidx, i, j);
if ((special & MG_PET) != 0 && ::iflags.hilite_pet) {
painter.drawPixmap(QPoint(i * gW, j * gH),
int ch = Glyphttychar(i,j);
unsigned special = Glyphflags(i,j);
unsigned short tileidx = Glyphtileidx(i,j);
- bool femflag = (special & MG_FEMALE) ? true : false;
- qt_settings->glyphs().drawCell(painter, g, tileidx,
- i, j, femflag);
+
+ qt_settings->glyphs().drawCell(painter, g, tileidx, i, j);
#ifdef TEXTCOLOR
if ((special & MG_PET) != 0 && ::iflags.hilite_pet) {
painter.drawPixmap(QPoint(i*qt_settings->glyphs().width(),
{
}
- void setGlyph(int g, int tileidx, bool fem)
+ void setGlyph(int g, int tileidx)
{
NetHackQtGlyphs& glyphs = qt_settings->glyphs();
int gw = glyphs.width();
int gh = glyphs.height();
QPixmap pm(gw,gh);
QPainter p(&pm);
- glyphs.drawGlyph(p, g, tileidx, 0, 0, fem);
+ glyphs.drawGlyph(p, g, tileidx, 0, 0, false);
p.end();
setIcon(QIcon(pm));
//RLC setHeight(std::max(pm.height()+1,height()));
glyph_info gi;
int glyph = monnum_to_glyph(roles[id].malenum, MALE);
map_glyphinfo(0, 0, glyph, 0, &gi);
- setGlyph(glyph, gi.gm.tileidx, false);
+ setGlyph(glyph, gi.gm.tileidx);
}
};
glyph_info gi;
int glyph = monnum_to_glyph(races[id].malenum, MALE);
map_glyphinfo(0, 0, glyph, 0, &gi);
- setGlyph(glyph, gi.gm.tileidx, false);
+ setGlyph(glyph, gi.gm.tileidx);
}
};
map_glyphinfo(0, 0, glyph, 0, &gi);
QTableWidgetItem *item = new QTableWidgetItem(
- QIcon(qt_settings->glyphs().glyph(glyph, gi.gm.tileidx, fem)),
+ QIcon(qt_settings->glyphs().glyph(glyph, gi.gm.tileidx)),
(fem && roles[i].name.f) ? roles[i].name.f : roles[i].name.m);
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
role->setItem(i, 0, item);
map_glyphinfo(0, 0, glyph, 0, &gi);
QTableWidgetItem *item = new QTableWidgetItem(
- QIcon(qt_settings->glyphs().glyph(glyph, gi.gm.tileidx, fem)),
+ QIcon(qt_settings->glyphs().glyph(glyph, gi.gm.tileidx)),
races[i].noun);
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
race->setItem(i, 0, item);