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

Method drawGlyph

win/Qt/qt_glyph.cpp:108–130  ·  view source on GitHub ↗

display a map tile somewhere other than the map; used for paper doll and also role/race selection

Source from the content-addressed store, hash-verified

106// display a map tile somewhere other than the map;
107// used for paper doll and also role/race selection
108void
109NetHackQtGlyphs::drawGlyph(
110 QPainter& painter,
111 int glyph, int tileidx,
112 int x, int y,
113 bool reversed)
114{
115 if (!reversed) {
116#if 0
117 int tile = glyph2tile[glyph];
118#else
119 int tile = tileidx;
120#endif
121 int px = (tile % tiles_per_row) * width();
122 int py = tile / tiles_per_row * height();
123
124 painter.drawPixmap(x, y, pm, px, py, width(), height());
125 } else {
126 // for paper doll; mirrored image for left side of two-handed weapon
127 painter.drawPixmap(x, y, reversed_pixmap(glyph, tileidx),
128 0, 0, width(), height());
129 }
130}
131
132// draw a tile into the paper doll
133void

Callers 1

setGlyphMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected