When tiles fail to load, the Qt interface switches to the text map. But it wasn't inhibiting the player from trying to switch to tiles map. Also, when the text map was in use it was forcing the paper doll inventory subset to be disabled regardless of whether the map was by choice or because tiles wouldn't load. Allow the paper doll in combination with the text map if tiles got loaded successfully.
50 lines
1.3 KiB
C++
50 lines
1.3 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:
|
|
bool no_tiles;
|
|
|
|
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 tileidx,
|
|
int pixelx, int pixely,
|
|
bool fem, bool reversed = false);
|
|
void drawCell(QPainter &, int glyph, int tileidx,
|
|
int cellx, int celly, bool fem);
|
|
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);
|
|
|
|
private:
|
|
QImage img;
|
|
QPixmap pm,pm1, pm2;
|
|
QSize size;
|
|
int tiles_per_row;
|
|
//QTransform *mirrormatrix;
|
|
};
|
|
|
|
} // namespace nethack_qt_
|
|
|
|
#endif
|