Honour more WINCAP flags.
This commit is contained in:
@@ -83,6 +83,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef QT_GRAPHICS
|
#ifdef QT_GRAPHICS
|
||||||
|
# define DEFAULT_WC_TILED_MAP /* Default to tiles if users doesn't say wc_ascii_map */
|
||||||
# define USER_SOUNDS /* Use sounds */
|
# define USER_SOUNDS /* Use sounds */
|
||||||
# define USE_XPM /* Use XPM format for images (required) */
|
# define USE_XPM /* Use XPM format for images (required) */
|
||||||
# define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.ppm) */
|
# define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.ppm) */
|
||||||
|
|||||||
@@ -17,6 +17,12 @@ NEARDATA struct instance_flags iflags; /* provide linkage */
|
|||||||
|
|
||||||
#define WINTYPELEN 16
|
#define WINTYPELEN 16
|
||||||
|
|
||||||
|
#ifdef DEFAULT_WC_TILED_MAP
|
||||||
|
#define PREFER_TILED TRUE
|
||||||
|
#else
|
||||||
|
#define PREFER_TILED FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NOTE: If you add (or delete) an option, please update the short
|
* NOTE: If you add (or delete) an option, please update the short
|
||||||
* options help (option_help()), the long options help (dat/opthelp),
|
* options help (option_help()), the long options help (dat/opthelp),
|
||||||
@@ -38,7 +44,7 @@ static struct Bool_Opt
|
|||||||
#else
|
#else
|
||||||
{"altmeta", (boolean *)0, TRUE, DISP_IN_GAME},
|
{"altmeta", (boolean *)0, TRUE, DISP_IN_GAME},
|
||||||
#endif
|
#endif
|
||||||
{"ascii_map", &iflags.wc_ascii_map, TRUE, SET_IN_GAME}, /*WC*/
|
{"ascii_map", &iflags.wc_ascii_map, !PREFER_TILED, SET_IN_GAME}, /*WC*/
|
||||||
#ifdef MFLOPPY
|
#ifdef MFLOPPY
|
||||||
{"asksavedisk", &flags.asksavedisk, FALSE, SET_IN_GAME},
|
{"asksavedisk", &flags.asksavedisk, FALSE, SET_IN_GAME},
|
||||||
#else
|
#else
|
||||||
@@ -170,7 +176,7 @@ static struct Bool_Opt
|
|||||||
{"sparkle", &flags.sparkle, TRUE, SET_IN_GAME},
|
{"sparkle", &flags.sparkle, TRUE, SET_IN_GAME},
|
||||||
{"standout", &flags.standout, FALSE, SET_IN_GAME},
|
{"standout", &flags.standout, FALSE, SET_IN_GAME},
|
||||||
{"splash_screen", &iflags.wc_splash_screen, TRUE, DISP_IN_GAME}, /*WC*/
|
{"splash_screen", &iflags.wc_splash_screen, TRUE, DISP_IN_GAME}, /*WC*/
|
||||||
{"tiled_map", &iflags.wc_tiled_map, FALSE, DISP_IN_GAME}, /*WC*/
|
{"tiled_map", &iflags.wc_tiled_map, PREFER_TILED, DISP_IN_GAME}, /*WC*/
|
||||||
{"time", &flags.time, FALSE, SET_IN_GAME},
|
{"time", &flags.time, FALSE, SET_IN_GAME},
|
||||||
#ifdef TIMED_DELAY
|
#ifdef TIMED_DELAY
|
||||||
{"timed_delay", &flags.nap, TRUE, SET_IN_GAME},
|
{"timed_delay", &flags.nap, TRUE, SET_IN_GAME},
|
||||||
|
|||||||
@@ -1583,8 +1583,13 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
|||||||
|
|
||||||
painter.begin(this);
|
painter.begin(this);
|
||||||
|
|
||||||
|
if (
|
||||||
#ifdef REINCARNATION
|
#ifdef REINCARNATION
|
||||||
if (Is_rogue_level(&u.uz)) {
|
Is_rogue_level(&u.uz) ||
|
||||||
|
#endif
|
||||||
|
iflags.wc_ascii_map
|
||||||
|
)
|
||||||
|
{
|
||||||
// You enter a VERY primitive world!
|
// You enter a VERY primitive world!
|
||||||
|
|
||||||
painter.setClipRect( event->rect() ); // (normally we don't clip)
|
painter.setClipRect( event->rect() ); // (normally we don't clip)
|
||||||
@@ -1595,8 +1600,16 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
|||||||
if ( !rogue_font ) {
|
if ( !rogue_font ) {
|
||||||
// Find font...
|
// Find font...
|
||||||
int pts = 5;
|
int pts = 5;
|
||||||
|
QString fontfamily = iflags.wc_font_map
|
||||||
|
? iflags.wc_font_map : "Courier";
|
||||||
|
bool bold = FALSE;
|
||||||
|
if ( fontfamily.right(5).lower() == "-bold" ) {
|
||||||
|
fontfamily.truncate(fontfamily.length()-5);
|
||||||
|
bold = TRUE;
|
||||||
|
}
|
||||||
while ( pts < 32 ) {
|
while ( pts < 32 ) {
|
||||||
painter.setFont(QFont("Courier", pts));
|
QFont f(fontfamily, pts, bold ? QFont::Bold : QFont::Normal);
|
||||||
|
painter.setFont(QFont(fontfamily, pts));
|
||||||
QFontMetrics fm = painter.fontMetrics();
|
QFontMetrics fm = painter.fontMetrics();
|
||||||
if ( fm.width("M") > qt_settings->glyphs().width() )
|
if ( fm.width("M") > qt_settings->glyphs().width() )
|
||||||
break;
|
break;
|
||||||
@@ -1604,7 +1617,7 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
|||||||
break;
|
break;
|
||||||
pts++;
|
pts++;
|
||||||
}
|
}
|
||||||
rogue_font = new QFont("Courier",pts-1);
|
rogue_font = new QFont(fontfamily,pts-1);
|
||||||
}
|
}
|
||||||
painter.setFont(*rogue_font);
|
painter.setFont(*rogue_font);
|
||||||
|
|
||||||
@@ -1641,9 +1654,7 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
painter.setFont(font());
|
painter.setFont(font());
|
||||||
} else
|
} else {
|
||||||
#endif
|
|
||||||
{
|
|
||||||
for (int j=garea.top(); j<=garea.bottom(); j++) {
|
for (int j=garea.top(); j<=garea.bottom(); j++) {
|
||||||
for (int i=garea.left(); i<=garea.right(); i++) {
|
for (int i=garea.left(); i<=garea.right(); i++) {
|
||||||
unsigned short g=Glyph(i,j);
|
unsigned short g=Glyph(i,j);
|
||||||
@@ -4335,7 +4346,7 @@ NetHackQtBind::NetHackQtBind(int& argc, char** argv) :
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
QPixmap pm("nhsplash.xpm");
|
QPixmap pm("nhsplash.xpm");
|
||||||
if ( !pm.isNull() ) {
|
if ( iflags.wc_splash_screen && !pm.isNull() ) {
|
||||||
QVBox *vb = new QVBox(0,0,
|
QVBox *vb = new QVBox(0,0,
|
||||||
WStyle_Customize | WStyle_NoBorder | nh_WX11BypassWM | WStyle_StaysOnTop );
|
WStyle_Customize | WStyle_NoBorder | nh_WX11BypassWM | WStyle_StaysOnTop );
|
||||||
splash = vb;
|
splash = vb;
|
||||||
@@ -5056,7 +5067,10 @@ extern "C" struct window_procs Qt_procs;
|
|||||||
|
|
||||||
struct window_procs Qt_procs = {
|
struct window_procs Qt_procs = {
|
||||||
"Qt",
|
"Qt",
|
||||||
WC_COLOR|WC_HILITE_PET,
|
WC_COLOR|WC_HILITE_PET|
|
||||||
|
WC_ASCII_MAP|WC_TILED_MAP|
|
||||||
|
WC_FONT_MAP|WC_TILE_FILE|WC_TILE_WIDTH|WC_TILE_HEIGHT|
|
||||||
|
WC_PLAYER_SELECTION|WC_SPLASH_SCREEN,
|
||||||
NetHackQtBind::qt_init_nhwindows,
|
NetHackQtBind::qt_init_nhwindows,
|
||||||
NetHackQtBind::qt_player_selection,
|
NetHackQtBind::qt_player_selection,
|
||||||
NetHackQtBind::qt_askname,
|
NetHackQtBind::qt_askname,
|
||||||
|
|||||||
@@ -1161,6 +1161,11 @@ int color;
|
|||||||
if (windowprocs.name != NULL &&
|
if (windowprocs.name != NULL &&
|
||||||
!strcmpi(windowprocs.name, "Gem")) return TRUE;
|
!strcmpi(windowprocs.name, "Gem")) return TRUE;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef QT_GRAPHICS
|
||||||
|
/* XXX has_color() should be added to windowprocs */
|
||||||
|
if (windowprocs.name != NULL &&
|
||||||
|
!strcmpi(windowprocs.name, "Qt")) return TRUE;
|
||||||
|
#endif
|
||||||
#ifdef AMII_GRAPHICS
|
#ifdef AMII_GRAPHICS
|
||||||
/* hilites[] not used */
|
/* hilites[] not used */
|
||||||
return iflags.use_color;
|
return iflags.use_color;
|
||||||
|
|||||||
Reference in New Issue
Block a user