more window port interface adjustments
further adjustments to the window port interface to pass a pointer to a glyph_info struct which describes not just the glyph number itself, but also the ttychar, the color, the glyphflags, and the symset index. This affects two existing window port calls that get passed glyphs and does the parameter consistently for both of them using the glyph_info struct pointer: print_glyph() add_menu(). The recently added glyphmod parameter is now unnecessary and has been removed.
This commit is contained in:
+6
-5
@@ -423,12 +423,12 @@ void NetHackQtBind::qt_start_menu(winid wid, unsigned long mbehavior UNUSED)
|
||||
window->StartMenu(wid == WIN_INVEN);
|
||||
}
|
||||
|
||||
void NetHackQtBind::qt_add_menu(winid wid, int glyph,
|
||||
void NetHackQtBind::qt_add_menu(winid wid, const glyph_info *glyphinfo,
|
||||
const ANY_P * identifier, CHAR_P ch, CHAR_P gch, int attr,
|
||||
const char *str, unsigned itemflags)
|
||||
{
|
||||
NetHackQtWindow* window=id_to_window[(int)wid];
|
||||
window->AddMenu(glyph, identifier, ch, gch, attr,
|
||||
window->AddMenu(glyphinfo->glyph, identifier, ch, gch, attr,
|
||||
QString::fromLatin1(str),
|
||||
itemflags);
|
||||
}
|
||||
@@ -474,12 +474,13 @@ void NetHackQtBind::qt_cliparound_window(winid wid, int x, int y)
|
||||
NetHackQtWindow* window=id_to_window[(int)wid];
|
||||
window->ClipAround(x,y);
|
||||
}
|
||||
void NetHackQtBind::qt_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,int glyph,
|
||||
int bkglyph UNUSED, unsigned *glyphmod)
|
||||
void NetHackQtBind::qt_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,
|
||||
const glyph_info *glyphinfo,
|
||||
const glyph_info *bkglyphinfo UNUSED)
|
||||
{
|
||||
/* TODO: bkglyph */
|
||||
NetHackQtWindow* window=id_to_window[(int)wid];
|
||||
window->PrintGlyph(x,y,glyph,glyphmod);
|
||||
window->PrintGlyph(x,y,glyphinfo);
|
||||
}
|
||||
//void NetHackQtBind::qt_print_glyph_compose(winid wid,xchar x,xchar y,int glyph1, int glyph2)
|
||||
//{
|
||||
|
||||
+3
-2
@@ -52,7 +52,7 @@ public:
|
||||
static void qt_putstr(winid wid, int attr, const QString& text);
|
||||
static void qt_display_file(const char *filename, BOOLEAN_P must_exist);
|
||||
static void qt_start_menu(winid wid, unsigned long mbehavior);
|
||||
static void qt_add_menu(winid wid, int glyph,
|
||||
static void qt_add_menu(winid wid, const glyph_info *glyphinfo,
|
||||
const ANY_P * identifier, CHAR_P ch, CHAR_P gch, int attr,
|
||||
const char *str, unsigned int itemflags);
|
||||
static void qt_end_menu(winid wid, const char *prompt);
|
||||
@@ -64,7 +64,8 @@ public:
|
||||
static void qt_cliparound(int x, int y);
|
||||
static void qt_cliparound_window(winid wid, int x, int y);
|
||||
static void qt_print_glyph(winid wid, XCHAR_P x, XCHAR_P y,
|
||||
int glyph, int bkglyph, unsigned int *);
|
||||
const glyph_info *glyphingo,
|
||||
const glyph_info *bkglyphinfo);
|
||||
static void qt_raw_print(const char *str);
|
||||
static void qt_raw_print_bold(const char *str);
|
||||
static int qt_nhgetch();
|
||||
|
||||
+14
-13
@@ -536,13 +536,13 @@ void NetHackQtMapViewport::CursorTo(int x,int y)
|
||||
Changed(cursor.x(), cursor.y());
|
||||
}
|
||||
|
||||
void NetHackQtMapViewport::PrintGlyph(int x, int y, int theglyph,
|
||||
unsigned *glyphmod)
|
||||
void NetHackQtMapViewport::PrintGlyph(int x, int y,
|
||||
const glyph_info *glyphinfo)
|
||||
{
|
||||
Glyph(x, y) = (unsigned short) theglyph;
|
||||
Glyphttychar(x, y) = (unsigned short) glyphmod[GM_TTYCHAR];
|
||||
Glyphcolor(x, y) = (unsigned short) glyphmod[GM_COLOR];
|
||||
Glyphflags(x, y) = glyphmod[GM_FLAGS];
|
||||
Glyph(x, y) = (unsigned short) glyphinfo->glyph;
|
||||
Glyphttychar(x, y) = (unsigned short) glyphinfo->ttychar;
|
||||
Glyphcolor(x, y) = (unsigned short) glyphinfo->color;
|
||||
Glyphflags(x, y) = glyphinfo->glyphflags;
|
||||
Changed(x, y);
|
||||
}
|
||||
|
||||
@@ -647,9 +647,10 @@ void NetHackQtMapWindow2::ClipAround(int x,int y)
|
||||
ensureVisible(x,y,width()*0.45,height()*0.45);
|
||||
}
|
||||
|
||||
void NetHackQtMapWindow2::PrintGlyph(int x,int y,int glyph, unsigned *glyphmod)
|
||||
void NetHackQtMapWindow2::PrintGlyph(int x,int y,
|
||||
const glyph_info *glyphinfo)
|
||||
{
|
||||
m_viewport->PrintGlyph(x, y, glyph, glyphmod);
|
||||
m_viewport->PrintGlyph(x, y, glyphinfo);
|
||||
}
|
||||
|
||||
#if 0 //RLC
|
||||
@@ -1004,12 +1005,12 @@ void NetHackQtMapWindow::ClipAround(int x,int y)
|
||||
viewport.center(x,y,0.45,0.45);
|
||||
}
|
||||
|
||||
void NetHackQtMapWindow::PrintGlyph(int x,int y,int glyph, unsigned *glyphmod)
|
||||
void NetHackQtMapWindow::PrintGlyph(int x,int y, const glyph_info *glyphinfo)
|
||||
{
|
||||
Glyph(x,y)=glyph;
|
||||
Glyphttychar(x,y)=glyphmod[GM_TTYCHAR];
|
||||
Glyphcolor(x,y)=glyphmod[GM_COLOR];
|
||||
Glyphflags(x,y)=glyphmod[GM_FLAGS];
|
||||
Glyph(x,y)=glyphinfo->glyph;
|
||||
Glyphttychar(x,y)=glyphinfo->ttychar;
|
||||
Glyphcolor(x,y)=glyphinfo->color;
|
||||
Glyphflags(x,y)=glyphinfo->glyphflags;
|
||||
Changed(x,y);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -56,7 +56,7 @@ private:
|
||||
void Clear();
|
||||
void Display(bool block);
|
||||
void CursorTo(int x,int y);
|
||||
void PrintGlyph(int x,int y,int glyph,unsigned *glyphmod);
|
||||
void PrintGlyph(int x,int y, const glyph_info *glyphinfo);
|
||||
void Changed(int x, int y);
|
||||
void updateTiles();
|
||||
void SetupTextmapFont(QPainter &painter);
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
virtual void CursorTo(int x,int y);
|
||||
virtual void PutStr(int attr, const QString& text);
|
||||
virtual void ClipAround(int x,int y);
|
||||
virtual void PrintGlyph(int x,int y,int glyph,unsigned *glyphmod);
|
||||
virtual void PrintGlyph(int x,int y, const glyph_info *glyphinfo);
|
||||
|
||||
signals:
|
||||
void resized();
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ void NetHackQtWindow::EndMenu(const QString& prompt UNUSED) { puts("unexpected E
|
||||
int NetHackQtWindow::SelectMenu(int how UNUSED, MENU_ITEM_P **menu_list UNUSED)
|
||||
{ puts("unexpected SelectMenu"); return 0; }
|
||||
void NetHackQtWindow::ClipAround(int x UNUSED,int y UNUSED) { puts("unexpected ClipAround"); }
|
||||
void NetHackQtWindow::PrintGlyph(int x UNUSED,int y UNUSED,int glyph UNUSED, unsigned *glyphmod UNUSED) { puts("unexpected PrintGlyph"); }
|
||||
void NetHackQtWindow::PrintGlyph(int x UNUSED,int y UNUSED,const glyph_info *glyphinfo UNUSED) { puts("unexpected PrintGlyph"); }
|
||||
//void NetHackQtWindow::PrintGlyphCompose(int x,int y,int,int) { puts("unexpected PrintGlyphCompose"); }
|
||||
void NetHackQtWindow::UseRIP(int how UNUSED, time_t when UNUSED) { puts("unexpected UseRIP"); }
|
||||
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ public:
|
||||
virtual void EndMenu(const QString& prompt);
|
||||
virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
|
||||
virtual void ClipAround(int x, int y);
|
||||
virtual void PrintGlyph(int x, int y, int glyph, unsigned *glyphmod);
|
||||
virtual void PrintGlyph(int x, int y, const glyph_info *glyphinfo);
|
||||
virtual void UseRIP(int how, time_t when);
|
||||
|
||||
int nhid;
|
||||
|
||||
Reference in New Issue
Block a user