Qt map's "ttychar"

Change the glyphttychar[ROWNO][COLNO] array from uchar to
unsighed short.  DrawWalls() has handling for values in over 2000.

This also reformats pretty much all of the NetHackQtMapViewport
portion of qt_map.cpp.
This commit is contained in:
PatR
2020-12-28 10:01:43 -08:00
parent c31047984b
commit 524f9dd82b
2 changed files with 128 additions and 164 deletions
+23 -15
View File
@@ -23,26 +23,34 @@ public:
protected:
virtual void paintEvent(QPaintEvent* event);
bool DrawWalls(QPainter& painter, int x, int y,
int w, int h, unsigned ch);
int w, int h, unsigned short ch);
virtual QSize sizeHint() const;
virtual QSize minimumSizeHint() const;
virtual void mousePressEvent(QMouseEvent* event);
private:
QFont *rogue_font;
unsigned short glyph[ROWNO][COLNO];
unsigned short& Glyph(int x, int y) { return glyph[y][x]; }
uchar glyphttychar[ROWNO][COLNO];
uchar& Glyphttychar(int x, int y) { return glyphttychar[y][x]; }
uchar glyphcolor[ROWNO][COLNO];
uchar& Glyphcolor(int x, int y) { return glyphcolor[y][x]; }
unsigned int glyphflags[ROWNO][COLNO];
unsigned int& Glyphflags(int x, int y) { return glyphflags[y][x]; }
QPoint cursor;
QPixmap pet_annotation;
QFont *rogue_font;
unsigned short glyph[ROWNO][COLNO];
unsigned short &Glyph(int x, int y) {
return glyph[y][x];
}
unsigned short glyphttychar[ROWNO][COLNO];
unsigned short &Glyphttychar(int x, int y) {
return glyphttychar[y][x];
}
unsigned short glyphcolor[ROWNO][COLNO];
unsigned short &Glyphcolor(int x, int y) {
return glyphcolor[y][x];
}
unsigned int glyphflags[ROWNO][COLNO];
unsigned int &Glyphflags(int x, int y) {
return glyphflags[y][x];
}
QPoint cursor;
QPixmap pet_annotation;
QPixmap pile_annotation;
NetHackQtClickBuffer& clicksink;
Clusterizer change;
NetHackQtClickBuffer &clicksink;
Clusterizer change;
void clickCursor();
void Clear();
@@ -51,7 +59,7 @@ private:
void PrintGlyph(int x,int y,int glyph,unsigned *glyphmod);
void Changed(int x, int y);
void updateTiles();
void SetRogueFont(QPainter &painter);
void SetupTextmapFont(QPainter &painter);
// NetHackQtMapWindow2 passes through many calls to the viewport
friend class NetHackQtMapWindow2;